SCM

Forum: help

Monitor Forum | Start New Thread Start New Thread
RE: constraints in maxLik package [ Reply ]
By: Ott Toomet on 2015-02-12 19:49
[forum:41902]
Dear Craig,
So you have 100 parameters, all (or many) of which must be in [0,1]?

I think you need 2 inequality constraint per parameter: A_11 theta_1 + 0 > 0; and -A_21 theta_1 + 1 > 0. And now you stack all such constraints into ineqA and ineqB matrices. Haven't tested though.

Alternatively, program your likelihood function in a way that it returns NA as soon as any of the paramters is out of range.

You may also parameterize in a different way. For instance, you optimize over unconstrained beta, and your parameter of interest theta = exp(beta)/(1 + exp(beta)).

However, in all cases you may end up with wrong inference where the constraints are actually bounding. Maxlik still uses unconstrained Hessian in such cases and hence your standard errors are most likely wrong. (Literature suggestions on how to fix it are welcome ;-) In other two cases you may run into convergence issues.

Cheers,
Ott

RE: constraints in maxLik package [ Reply ]
By: Craig Brown on 2015-02-12 18:58
[forum:41901]
Arne,

I'm still not confident that I know how to use constraints. In my case, I would like to bound the results of the optimization to values between 0 and 1. This is for datasets on the order of 1000's of equations with 100 unknowns, I would like the estimates to fall between 0 and 1. Is it possible to do this and, if so, how? Thank you.

RE: constraints in maxLik package [ Reply ]
By: Arne Henningsen on 2014-10-31 21:31
[forum:41613]
Dear Graziella

I am not sure if I completely understand your question. In R, you can create a matrix with the command matrix(). Please note that the documentation of the function maxBFGS() explains how to specify constraints and it "Examples" section includes R code of an example for constrained optimisation.

Best wishes,
Arne

constraints in maxLik package [ Reply ]
By: Graziella Bonanno on 2014-10-30 11:42
[forum:41603]
Dear All,
how can I write the matrix of constraints before using "maxLik" to maximize a log-likelihood function?

Are there any suggestions, please?

The constraints are related to the values of parameters to be estimated.

Thanks,
Graziella


Thanks to:
Vienna University of Economics and Business Powered By FusionForge