[R] Optim (fct): Parameters=LowerBounds
John C Nash
nashjc at uottawa.ca
Tue May 1 15:55:34 CEST 2012
There's no reason that the optimum cannot be at the bounds. Bounded problems really do
sometimes have solutions on those bounds.
Compute the unconstrained gradient of your objective function at the bounds and see if the
function is reduced when going across the bounds. The function here is assumed to be the
neg. LL that one is MINIMIZING.
There are many aspects of R, optimization in particular, where it would help if we
required an operator's license. It is not a magical spell that solves problems
automatically, but a tool much like a chainsaw that can as easily cut your arm off as saw
a log.
JN
On 05/01/2012 06:00 AM, r-help-request at r-project.org wrote:
> Message: 54 Date: Mon, 30 Apr 2012 08:30:24 -0700 (PDT) From: barb <mainzel89 at hotmail.com>
> To: r-help at r-project.org Subject: [R] Optim (fct): Parameters=LowerBounds!? Message-ID:
> <1335799824557-4598504.post at n4.nabble.com> Content-Type: text/plain; charset=UTF-8 Hey, i
> am trying to do the MLE for Garch and have a problem with the optim function. Initally i
> tried optim with Method=BFGS. Reading trhough the forum i found out i would neet bounds.
> So i went on with Method=L-BFGS-B. But now my parameters equal the lower bounds.
>> > out <- optim(par=initial, fn=LogLik.GARCH,X=X, P=1, Q=1, method =
>> > "L-BFGS-B",lower =c(0.01,0.01,0.01), upper =c(0.99,0.99,0.99))
>> > out
> -----------------------------------
> *$par
> [1] 0.01 0.01 0.01*
> [...]
> $convergence
> [1] 0
>
> *$message
> [1] "CONVERGENCE: NORM OF PROJECTED GRADIENT <=
> PGTOL"*-----------------------------------
>
More information about the R-help
mailing list