\(\newcommand{\B}[1]{ {\bf #1} }\) \(\newcommand{\R}[1]{ {\rm #1} }\) \(\newcommand{\W}[1]{ \; #1 \; }\)
initialize¶
View page sourceInitialization After Constructor¶
Syntax¶
size_map = mixed_object . initialize ( fixed_vec , random_vec )
Public¶
This cppad_mixed base_class member function is public.
Purpose¶
Some of the cppad_mixed initialization requires calling the
derived class version of the
ran_likelihood function.
Hence this initialization cannot be done until
after the derived constructor completes.
mixed_object¶
We use mixed_object
to denote an object of a class that is
derived from the cppad_mixed base class.
fixed_vec¶
This argument has prototype
const CppAD::vector<double>&fixed_vec
It specifies the value of the
fixed effects
vector \(\theta\) at which certain CppAD::ADFun
objects are recorded.
random_vec¶
This argument has prototype
const CppAD::vector<double>&random_vec
It specifies the value of the
random effects
vector \(u\) at which certain CppAD::ADFun
objects are recorded.
size_map¶
The return value has prototype
std::map<std::string,size_t>size_map
It represent the size of certain aspects of the problem.
n_fixed¶
the number of fixed effects.
n_random¶
the number of fixed effects.
quasi_fixed¶
If this is one (zero) are a using a quasi-Newton (Newton) method for optimizing the fixed effects.
A_nr¶
is the number of rows in the liner constraint matrix A (the matrix has n_fixed columns).
A_nnz¶
is the number of non-zeros in the liner constraint matrix A.
ran_like_fun.size_var¶
is the number of variables in the algorithm that maps the fixed and random effects to the part of the likelihood that depend on the random effects.
fix_like_fun.size_var¶
is the number of variables in the algorithm that maps the fixed effects to the part of the likelihood that does not depend on the random effects.
Other Fields¶
Not all the fields in size_map are specified, but they can be inspected. For example,
std::map<std::string , size_t>::iterator itr ;for ( itr = size_map . begin (); itr != size_map . end (); itr ++)std::cout << itr->first << “ = “ << itr->second << “\ n “;Example¶
The file derived_ctor.cpp contains an example
of using initialize .