Steven,
A quick trick to deal with problems of this nature (i.e. forcing
parameters to stay positive although the parameter search isn't bound
to non-negatives or positives) without resorting to another package is
to re-parametrize the density function.
Notice,
x \in (-\infty,\infty) for x \in (-
-help-boun...@r-project.org] On
Behalf Of Prof. John C Nash
Sent: Monday, December 07, 2009 9:01 AM
To: r-help@r-project.org
Subject: Re: [R] optim with constraints
Without the data / script, I'm guessing that it is likely an attempt to
evaluate the loss
function at an inadmissible point e.g., at
other things) on trying to provide a nice wrapper to catch
these exceptions so that they can be handled better.
JN
Message: 56
Date: Sun, 6 Dec 2009 17:32:54 -0800 (PST)
From: Steven
Subject: Re: [R] optim with constraints
To: r-help@r-project.org
Message-ID:
<88d5c01d-c30c-4
function on
> R-forgehttp://r-forge.r-project.org/R/?group_id=395
> is a wrapper that allows some other methods too.
>
> JN
>
>
>
>
>
> > Message: 72
> > Date: Sun, 6 Dec 2009 02:53:55 -0800 (PST)
> > From: Steven
> > Subject: [R] optim with cons
-
From: Steven
Date: Sunday, December 6, 2009 5:54 am
Subject: [R] optim with constraints
To: r-help@r-project.org
> Hi, dear R users
>
> I am a newbie in R and I wantto use the method of meximum likelihood
> to fit a Weibull distribution to my survival data. I use "op
function on R-forge
http://r-forge.r-project.org/R/?group_id=395
is a wrapper that allows some other methods too.
JN
Message: 72
Date: Sun, 6 Dec 2009 02:53:55 -0800 (PST)
From: Steven
Subject: [R] optim with constraints
To: r-help@r-project.org
Message-ID:
<5e293933-91f2-48f7-98e5-bc
Hi, dear R users
I am a newbie in R and I wantto use the method of meximum likelihood
to fit a Weibull distribution to my survival data. I use "optim" as
follows:
optim(c(1, 0.25),weibull.like,mydata=mydata,method="L-BFGS-B",hessian
= TRUE)
My question is: how do I setup the constraints so that
7 matches
Mail list logo