Thanks John , I did look at this function but seems that only works with censored (not truncated) normal distributions.
I know that a straightforward to do it is with fitdistr from MASS package: library(MASS) #fitdistr library(msm) #dtnorm, rtnorm #Generate truncated normal sample data<-rtnorm(1000,mean=108, sd=5, lower=105, upper= 136) #Trucated normal distribution dtnorm0 <- function(X, mean, sd, log = FALSE) {dtnorm(X, mean, sd, 105, 136, log)} #Fit data to normal tres <- fitdistr(data,"normal") #Fit data to truncated normal nres <- fitdistr(data, dtnorm0, start=list(mean=mean(data), sd=sd(data))) #results tres nres When 'data' came from a generated truncated normal distribution there is no problem. My problem is that I want to fit a real sample collected over 10 years. For each year,I only have the biased mean of the sample (like 'tres') and I want to estimate the mean of the population (like 'nres'). When I try to do it, I get correct estimates of the underlying normal distribution in some years but in others there is a message "optimization failed". I know that the underlying distribution is normal but some years my sample data does not look like this. I don't know how to get an estimation of the parameters in these "optimization failed" years and this is the reason to seek for some alternatives to 'fitdistr', but of course I can be wrong. Thanks David John C Frain wrote: > > This idea is very wrong, Have a look at the function cnormal1 in the > VGAM package > > John frain > > 2008/10/15 drbn <[EMAIL PROTECTED]>: >> >> I'm using stableFit from the package fBasics to estimate the parameters >> of a >> truncated normal distribution (I'm interested in the parameters of the >> underlying normal distribution). It is correct to generalize this >> truncated >> normal distribution as a stable distribution ? >> >> Thanks >> >> David >> -- >> View this message in context: >> http://www.nabble.com/stablefit-can-fit-the-parameters-of-a-truncated-normal-distribution--tp20002335p20002335.html >> Sent from the R help mailing list archive at Nabble.com. >> >> ______________________________________________ >> R-help@r-project.org mailing list >> https://stat.ethz.ch/mailman/listinfo/r-help >> PLEASE do read the posting guide >> http://www.R-project.org/posting-guide.html >> and provide commented, minimal, self-contained, reproducible code. >> > > > > -- > John C Frain > Trinity College Dublin > Dublin 2 > Ireland > www.tcd.ie/Economics/staff/frainj/home.html > mailto:[EMAIL PROTECTED] > mailto:[EMAIL PROTECTED] > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > > -- View this message in context: http://www.nabble.com/stablefit-can-fit-the-parameters-of-a-truncated-normal-distribution--tp20002335p20028459.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.