@(@\newcommand{\R}[1]{ {\rm #1} }
\newcommand{\B}[1]{ {\bf #1} }
\newcommand{\W}[1]{ \; #1 \; }@)@This is cppad_mixed--20220519 documentation: Here is a link to its
current documentation
.
Purpose
This routine draws independent samples from
the asymptotic posterior distribution for the
fixed effects (given the model and the data).
Constant Fixed Effects
If the upper and lower limits for a fixed effect are equal,
fixed_lower[j] == fixed_upper[j]
we refer to the j-th fixed effect as constant.
Constraints
Only the constant fixed effect constants are taken into account.
(This is an over estimate of the variance, but is faster to calculate
than trying to identify active constraints and treating them as equality
constraints.)
It can result in samples that are outside the limits
for the fixed effects that are not constant.
You may want to adjust the samples to be within
their upper and lower limits before you use them.
Covariance
Each sample of the fixed effects
(excluding the constant fixed effects)
has covariance equal to the inverse of the
information matrix
(where the constant fixed effects have been removed).
manage_gsl_rng
It is assumed that
get_gsl_rng
will return
a pointer to a GSL random number generator.
mixed_object
We use mixed_object
to denote an object of a class that is
derived from the cppad_mixed base class.
sample
The size
sample.size()
is a multiple of
n_fixed
.
The input value of its elements does not matter.
We define
n_sample = sample_size / n_fixed
If
error_msg
is empty, upon return
for
i = 0 , ..., n_sample-1
,
j = 0 , ..., n_fixed-1
,
sample[ i * n_fixed + j ]
is the j-th component of the i-th sample of the
optimal fixed effects @(@
\hat{\theta}
@)@.
These samples are independent for different @(@
i
@)@,
and for fixed @(@
i
@)@, they have the specified
covariance
.
hes_fixed_obj_rcv
This is a sparse matrix representation for the
lower triangle of the observed information matrix corresponding to
solution
; i.e., the matrix returned by
hes_fixed_obj_rcv = mixed_object.hes_fixed_obj( solution, random_opt
)
where
random_opt
is the optimal random effects corresponding
to
solution
.
solution
is the solution
for a the call to optimize_fixed
corresponding to
hes_fixed_obj_rcv
.
The only necessary information in this structure is
solution.fixed_opt
.
fixed_lower
is the same as
fixed_lower
in the call to optimize_fixed that corresponding to
solution
.
fixed_upper
is the same as
fixed_upper
in the call to optimize_fixed that corresponding to
solution
.
error_msg
If
error_msg
is empty (non-empty),
sample
values have been calculated (have not been calculated).
If
error_msg
is non-empty,
it is a message describing the problem.