MLE in R

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

MLE in R

Steven-2
Hi, dear R users

I am a newbie in R and I need to use the method of meximum likelihood to fit a Weibull distribution to my survival data. I use "optim" as follows:


optim(c(1.14,0.25),weibull.like,mydata=mydata,method="L-BFGS-B",hessian = TRUE)

My question is: how do I setup the constraints that the two parametrs of Weibull to be pisotive?

Many thanks! Any comments are greatly appreciated!

Steven
        [[alternative HTML version deleted]]

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: MLE in R

Uwe Ligges-3
Please read ?optim and about its arguments

lower, upper Bounds on the variables for the "L-BFGS-B" method.

Uwe Ligges


Liang Wang wrote:

> Hi, dear R users
>
> I am a newbie in R and I need to use the method of meximum likelihood to fit a Weibull distribution to my survival data. I use "optim" as follows:
>
>
> optim(c(1.14,0.25),weibull.like,mydata=mydata,method="L-BFGS-B",hessian = TRUE)
>
> My question is: how do I setup the constraints that the two parametrs of Weibull to be pisotive?
>
> Many thanks! Any comments are greatly appreciated!
>
> Steven
> [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] 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.

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: MLE in R

Francisco J. Zagmutt
In reply to this post by Steven-2
Hello Liang,

Besides looking at ?optim, you may also want to look into this nice
working example www.mayin.org/ajayshah/KB/R/documents/mle/mle.html

Regards,

Francisco

Francisco J. Zagmutt
Vose Consulting
1643 Spruce St., Boulder
Boulder, CO, 80302
USA
www.voseconsulting.com

Liang Wang wrote:

> Hi, dear R users
>
> I am a newbie in R and I need to use the method of meximum likelihood to fit a Weibull distribution to my survival data. I use "optim" as follows:
>
>
> optim(c(1.14,0.25),weibull.like,mydata=mydata,method="L-BFGS-B",hessian = TRUE)
>
> My question is: how do I setup the constraints that the two parametrs of Weibull to be pisotive?
>
> Many thanks! Any comments are greatly appreciated!
>
> Steven
> [[alternative HTML version deleted]]
>

______________________________________________
[hidden email] 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.