\(\newcommand{\B}[1]{ {\bf #1} }\) \(\newcommand{\R}[1]{ {\rm #1} }\)
mixed_optimize_fixed#
View page sourceOptimize The Fixed Effects#
Syntax#
# solution = mixed_obj.optimize_fixed(
fixed_ipopt_options = None ,
random_ipopt_options = None ,
fixed_lower = None ,
fixed_upper = None ,
fix_constraint_lower = None ,
fix_constraint_upper = None ,
fixed_scale = None ,
fixed_in = None ,
random_lower = None ,
random_upper = None ,
random_in = None ,
# )
Purpose#
This routine maximizes, with respect to the fixed effect \(\theta\), the Laplace approximation for the likelihood of the data and fixed effects.
If there are no random effects, there is no Laplace approximation of the integral above, and this routine maximizes \(\B{p} ( z | \theta ) \B{p} ( \theta )\) ; see Fixed Effects Likelihood. It also is no data, this routine maximizes \(\B{p} ( \theta )\).
Argument Types#
The arguments fixed_ipopt_options and random_ipopt_options
have type str. All the other arguments are
numpy vectors with elements of type float.
Limits#
As a lower (upper) limit, the value None is minus (plus) infinity;
i.e., no lower (upper) limit.
fixed_lower (fixed_upper)#
has length n_fixed and is the lower (upper) limit for the fixed effects.
fix_constraint_lower (fix_constraint_upper)#
has length equal to the size_range for the Fixed Effects Constraint Function and is the corresponding lower (upper) limit.
random_lower (random_upper)#
has length n_random and is the lower (upper) limit for the random effects. (The Laplace approximation assumes these bounds are not active.)
fixed_in (random_in)#
has length n_fixed (n_random) and is the initial value used during
optimization of the fixed (random) effects.
If fixed_in (random_in) is None, the value
fixed_init (random_init) is used; see
fixed_init, random_init .
fixed_scale#
has length n_fixed and is the value of the fixed at which the
fixed effect objective is scaled so its derivative is near one.
The value None corresponds to fixed_scale equal to fixed_in.
fixed_ipopt_options#
This contains the options for optimizing the fixed effects.
Each line of an options argument corresponds to an ipopt option
and is terminated by a \n character.
Each line has three non-empty tokens separated by one or more spaces.
The first token in each line is String, Integer, or Numeric;
see below.
ipopt options#
See the ipopt options documentation for a list of the options and how they affect the optimization.
String#
An Ipopt string option is specified by a line containing the following syntax:
String name valueInteger#
An Ipopt integer option specified specifies by a line containing the following syntax:
Integer name valueNumeric#
An Ipopt numeric option specified specifies by a line containing the following syntax:
Numeric name valuederivative_test#
If the string option is derivative_test, value can be
none, first-order, second-order, only-second-order.
If second order derivatives are tested,
quasi_fixed must be false.
In addition to the standard ipopt options above, value can be
adaptive or trace-adaptive which uses a special derivative
tester that adapts its step sizes for each argument component.
hessian_approximation#
If quasi_fixed is true, this string option (if present) must have value
limit_memory.
max_iter#
This integer option has a special value -1.
In this case ipopt is run with max_iter equal to zero,
and the return solution corresponds to the input value of the
fixed effects.
nlp_scaling_method#
The objective and constraint function are automatically scaled by cppad_mixed and it is an error to specify this option.
random_ipopt_options#
This contains the options for optimizing the random effects.
It has the same format as fixed_ipopt_options, but does
not have the special exceptions to the normal Ipopt options; e.g.,
adaptive is not available as a derivative_test value.
solution#
All the fields in the return value solution
are numpy vectors with elements of type float.
fixed_opt#
The value solution.fixed_opt has length
n_fixed and is the final value of the fixed effects
(after optimization).
If the max_iter is -1, it is equal to fixed_in.
fixed_lag#
The value solution.fixed_lag has length
n_fixed and is the Lagrange multipliers for
the fixed effects lower (upper) bounds if it is greater than (less than)
zero.
fix_con_lag#
The value solution.fix_con_lag is a Lagrange multipliers for
the fixed effects lower (upper) bounds if it is greater than (less than).
Its length is the same as the return value for the fixed effects constraint
function.
ran_con_lag#
The value solution.ran_con_lag is a Lagrange multipliers for the
rand effects constraint function.
Its length is the same as the random constrain matrix \(A\) ; see
A_rcv.