# Setting up a boundary for a parameter estimate

Hello everyone!

I am trying to set up an upper limit ( = 1 ) for a parameter estimate. Can you please let me know how to do this ?

0
accepted

'Maxlik' uses a global control variable named _max_Bounds. So to constrain all parameters to be less than 1, you could add this line of code before your call to 'Maxlik':

``````//Constrain all parameters to be less than 1
//assuming that -1e256 will be much less than the parameter estimates.
_max_Bounds = { -1e256 1 };``````
0

If you let us know which function you are using, we can provide more specific advice. However, generally, there is a control structure member or (for older application modules) a global control variable which controls the bounds.

In most (if not all) cases, the bounds setting can either be a 1x2 vector or a Px2 vector where 'P' is the number of parameters in the model. Here are a couple of examples showing how bounds would be set when using 'OPTMT'.

### One set of bounds for all parameters

``````//Declare 'ctl' to be an optmtControl struct
//and fill with default control settings
struct optmtControl ctl;
ctl = optmtControlCreate();

//Set bounds for ALL parameters in the model to be
//between 0 and 1
ctl.bounds = { 0 1 };``````

### Separate bounds for each parameter

If you specify bounds for more than one parameter, you must specify bounds for all parameters in the model. The example below shows how you would set bounds for a model with 2 parameters.

``````//Declare 'ctl' to be an optmtControl struct
//and fill with default control settings
struct optmtControl ctl;
ctl = optmtControlCreate();

//Set separate bounds for both parameters in the model
//Constrain the first parameter between -1.5 and +3
//Constrain the second parameter between 0 and 1
ctl.bounds = { -1.5 3
0  1 }; ``````
0

Thank you for you answer. I am using "Maxlik" function for estimating parameters. Can you please let me know what are the commands to set boundaries for parameters using Maxlik function.

### Have a Specific Question?

Get a real answer from a real person

### Need Support?

Get help from our friendly experts.