[R] Constraint on one of parameters.
Petr Savicky
savicky at cs.cas.cz
Sat Feb 11 10:26:52 CET 2012
On Fri, Feb 10, 2012 at 11:40:57PM -0600, FU-WEN LIANG wrote:
> Thanks for your suggestion.
> I did read the manual but it seems those examples set boundaries for every
> parameter. I have no idea how to set bound for only one parameter(in my
> case, only for theta[21]). I tried adding
> "method='L-BFGS-B',lower=c(rep(inf,20),-1),upper=c(rep(inf,20),1)", but got
> this error "object 'inf' not found". I thought for those unconstrained
Hi.
Names in R are case sensitive. The infinity is "Inf", not "inf".
> parameters I can set them as (-inf, inf), but the manual says using
> L-BFGS-B method, the estimated parameters should be finite numbers.
> My constrain on theta[21] is " -1 < theta[21] < 1"
> For those unconstrained parameters, how do I free them?
If the bound cannot be -Inf and Inf, try -1e308 and 1e308.
This is close to the bounds of the range of numeric values.
Hope this helps.
Petr Savicky.
More information about the R-help
mailing list