Re: [R] maximum likelihood estimation in R

2012-11-12 Thread Ben Bolker
David Winsemius comcast.net> writes: > > > On Nov 10, 2012, at 9:22 PM, mmosalman wrote: > > > I want to find ML estimates of a model using mle2 in bbmle package. When I > > insert new parameters (for new covariates) in model the log-likelihood value > > does not change and the estimated value

Re: [R] maximum likelihood estimation in R

2012-11-10 Thread David Winsemius
On Nov 10, 2012, at 9:22 PM, mmosalman wrote: > I want to find ML estimates of a model using mle2 in bbmle package. When I > insert new parameters (for new covariates) in model the log-likelihood value > does not change and the estimated value is exactly the initial value that I > determined. Wha

[R] maximum likelihood estimation in R

2012-11-10 Thread mmosalman
I want to find ML estimates of a model using mle2 in bbmle package. When I insert new parameters (for new covariates) in model the log-likelihood value does not change and the estimated value is exactly the initial value that I determined. What's the problem? This is the code and the result: As

[R] Maximum likelihood estimation in R

2010-07-19 Thread Maomao Luo
Dear R-helper, I am trying to do maximum likelihood estimation in R. I use the "optim" function. Since I have no prior information on the true values of the parameters, I just randomly select different sets of starting values to feed into the program. Each time, I get the following error

Re: [R] Maximum Likelihood Estimation in R

2010-04-22 Thread Henkep
Thank you! Best Regards Henrik -- View this message in context: http://r.789695.n4.nabble.com/Maximum-Likelihood-Estimation-in-R-tp2018822p2022832.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list h

Re: [R] Maximum Likelihood Estimation in R

2010-04-22 Thread Henkep
Abhishek: Thank you! Thomas: that worked out well, thank you again! I also tried to use lm, and as expected in this case, I almost got the same estimates of the parameters as in the MLE-case. Best Regards Henrik -- View this message in context: http://r.789695.n4.nabble.com/Maximum-L

Re: [R] Maximum Likelihood Estimation in R

2010-04-22 Thread Henkep
that worked out well, thank you again! I also tried to use lm, and as expected in this case, I almost got the same estimates of the parameters as in the MLE-case. Best Regards Henrik -- View this message in context: http://r.789695.n4.nabble.com/Maximum-Likelihood-Estimation-in-R-tp201882

Re: [R] Maximum Likelihood Estimation in R

2010-04-21 Thread Thomas Stewart
Henrik- A coding solutions may be ... + (1/(2*stdev*stdev))*sum( ( y-(rev/12)- c(0,y[-n]) *exp(-lap/12) )^2 ) where n is the number of observations in y. Personally, I would use lm. Your model can be written as a linear function. Let x=c(0,y[-n]). Then run lm(y~x). The parameter estimat

Re: [R] Maximum Likelihood Estimation in R

2010-04-21 Thread Henkep
Thank you Thomas. (a) an embarrassing mistake by me. Of course it should be squared. Thank you for pointing that out. (b) Do you possibly have any suggestions on how to solve this issue? I presume that there is no reason in trying to create a lagged "vector" manually? Best Regards Henrik --

Re: [R] Maximum Likelihood Estimation in R

2010-04-21 Thread Abhishek Pratap
Hey Henrik I dont do MLE myself but this recent blog might be helpful. http://www.johnmyleswhite.com/notebook/2010/04/21/doing-maximum-likelihood-estimation-by-hand-in-r/ -A On Wed, Apr 21, 2010 at 10:02 AM, Thomas Stewart wrote: > Two possible problems: > > (a) If you're working with a normal

Re: [R] Maximum Likelihood Estimation in R

2010-04-21 Thread Thomas Stewart
Two possible problems: (a) If you're working with a normal likelihood---and it seems that you are---the exponent should be squared. As in: ... + (1/(2*stdev*stdev))*sum( ( y-(rev/12)-lag(y)*exp(-lap/12) )^2 ) (b) lag may not be working like you think it should. Consider this silly example: y<

[R] Maximum Likelihood Estimation in R

2010-04-21 Thread Henkep
Dear R-Help, I also send the following post by e-mail to you, however I try to post it here aswell. My name is Henrik and I am currently trying to solve a Maximum Likelihood optimization problem in R. Below you can find the output from R, when I use the "BFGS" method: The problem is that the p

Re: [R] Maximum likelihood estimation in R with censored Data

2008-06-15 Thread Thomas Lumley
Try survreg(), in the survival package. -thomas On Fri, 13 Jun 2008, Bluder Olivia wrote: Hello, I'm trying to calculate the Maximum likelihood estimators for a dataset which contains censored data. I started by using the function "nlm", but isn't there a separate method for doing

Re: [R] Maximum likelihood estimation in R with censored Data

2008-06-13 Thread Vincent Goulet
Le ven. 13 juin à 13:55, Ben Bolker a écrit : Bluder Olivia k-ai.at> writes: Hello, I'm trying to calculate the Maximum likelihood estimators for a dataset which contains censored data. I started by using the function "nlm", but isn't there a separate method for doing this for e.g. t

Re: [R] Maximum likelihood estimation in R with censored Data

2008-06-13 Thread Ben Bolker
Bluder Olivia k-ai.at> writes: > > Hello, > > I'm trying to calculate the Maximum likelihood estimators for a dataset > which contains censored data. > > I started by using the function "nlm", but isn't there a separate method > for doing this for e.g. the "weibull" and the "log-normal" distri

[R] Maximum likelihood estimation in R with censored Data

2008-06-13 Thread Bluder Olivia
Hello, I'm trying to calculate the Maximum likelihood estimators for a dataset which contains censored data. I started by using the function "nlm", but isn't there a separate method for doing this for e.g. the "weibull" and the "log-normal" distribution? Thanks, Olivia [[a