Displaying 1 result from an estimated 1 matches for "my_fit_low".
2009 Aug 07
0
Fitting Truncated Distribution
...the link above)
rm(list=ls())
library(MASS)
set.seed(1234)
lt_lognormal <- function(x, meanlog, sdlog ){
dlnorm(x, meanlog , sdlog )/plnorm(0.5, meanlog , sdlog )
}
my_seq <- rlnorm(10000)
my_fit <- fitdistr(my_seq,"lognormal")
cut_low <- my_seq[which(my_seq>0.5)]
my_fit_low <- fitdistr(cut_low,lt_lognormal,list(meanlog=0.2,sdlog=0.7),
lower=0.5 )
However, when I run it I get the following error
Error in optim(x = c(1.31973273433717, 2.95778647676973,
1.53591253356589, :
L-BFGS-B needs finite values of 'fn'
Does anybody know what is going on? Am I ma...