Prev Next

@(@\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 .
cppad_mixed: Public Declarations

Cppad Mixed Types
User Defined Functions
     ran_likelihood
     fix_likelihood
     fix_constraint
     fatal_error
     warning
constructor
destructor
initialize
optimize_random
optimize_fixed
hes_fixed_obj
hes_random_obj
sample_fixed
sample_random
information_mat, Deprecated 2020-03-22
Contents
These cppad_mixed class declarations are public. They are part of the user API and can be used by a derived class object mixed_object .

Cppad Mixed Types
The following Cppad Mixed types are extended into the cppad_mixed class:
     // scalar types
     typedef CppAD::mixed::a1_double      a1_double;
     // vector types
     typedef CppAD::mixed::s_vector       s_vector;
     typedef CppAD::mixed::d_vector       d_vector;
     typedef CppAD::mixed::a1_vector      a1_vector;
     // sparse types
     typedef CppAD::mixed::sparse_rc      sparse_rc;
     typedef CppAD::mixed::d_sparse_rcv   d_sparse_rcv;
     typedef CppAD::mixed::a1_sparse_rcv  a1_sparse_rcv;

User Defined Functions
The following are cppad_mixed pure virtual functions. Each one has a default definition that may be replaced by the user's derived class:

ran_likelihood
This function is necessary if there are random effects in the model.
     virtual a1_vector ran_likelihood(
          const a1_vector& fixed_vec  ,
          const a1_vector& random_vec )
     {    return a1_vector(0); }
See ran_likelihood .

fix_likelihood
This function should be used if there is a prior on the fixed effects, or there is data that does not depend on the random effects.

     virtual a1_vector fix_likelihood(
          const a1_vector& fixed_vec )
     {    return a1_vector(0); }
See fix_likelihood .

fix_constraint
This function is used to define constraints that only depend on the fixed effects.

     virtual a1_vector fix_constraint(
          const a1_vector& fixed_vec )
     {    return a1_vector(0); }
See fix_constraint .

fatal_error
This routine displays an error message and then exits the program. Its default definition below can be replaced by a user definition. Note that if NDEBUG is not defined, this generates an assert, otherwise it exits.
     virtual void fatal_error(const std::string& error_message)
     {    std::cerr << "cppad_mixed error: " << error_message << std::endl;
          assert(false);
          exit(1);
     }
warning
This routine displays a warning message and then returns. Its default definition below can be replaced by a user definition.

     virtual void warning(const std::string& warning_message)
     {    std::cerr << "cppad_mixed warning: " << warning_message << std::endl;
     }

constructor
derived_ctor , User Defined Class Derived From cppad_mixed.
     // BEGIN_CPPAD_MIXED_CTOR
     cppad_mixed(
          size_t               n_fixed       ,
          size_t               n_random      ,
          bool                 quasi_fixed   = false           ,
          bool                 bool_sparsity = false           ,
          const d_sparse_rcv&  A_rcv         = d_sparse_rcv()  ,
          bool                 trace_init    = false
     );
     // END_CPPAD_MIXED_CTOR

destructor

     virtual ~cppad_mixed(void);

initialize
initialize , Initialization After Constructor
     std::map<std::string, size_t> initialize(
          const d_vector&  fixed_vec   ,
          const d_vector&  random_vec
     );

optimize_random
optimize_random , Optimize Random Effects.
     d_vector optimize_random(
          const std::string& options      ,
          const d_vector&    fixed_vec    ,
          const d_vector&    random_lower ,
          const d_vector&    random_upper ,
          const d_vector&    random_in
     );

optimize_fixed
optimize_fixed , Optimize Fixed Effects.
     CppAD::mixed::fixed_solution optimize_fixed(
          const std::string& fixed_ipopt_options   ,
          const std::string& random_ipopt_options  ,
          const d_vector&    fixed_lower           ,
          const d_vector&    fixed_upper           ,
          const d_vector&    fix_constraint_lower  ,
          const d_vector&    fix_constraint_upper  ,
          const d_vector&    fixed_scale           ,
          const d_vector&    fixed_in              ,
          const d_vector&    random_lower          ,
          const d_vector&    random_upper          ,
          const d_vector&    random_in             ,
          const CppAD::mixed::warm_start_struct&  warm_start =
               CppAD::mixed::warm_start_struct()
     );

hes_fixed_obj
hes_fixed_obj , Compute the Hessian of The Fixed Effects Objective.
     d_sparse_rcv hes_fixed_obj(
          const d_vector& fixed_vec  ,
          const d_vector& random_opt
     );

hes_random_obj
hes_random_obj , Compute the Hessian of The Random Effects Objective.
     d_sparse_rcv hes_random_obj(
          const d_vector& fixed_vec  ,
          const d_vector& random_vec
     );

sample_fixed
sample_fixed , Sample Posterior for Fixed Effects.
     std::string sample_fixed(
          d_vector&                            sample               ,
          const d_sparse_rcv&                  information_rcv      ,
          const CppAD::mixed::fixed_solution&  solution             ,
          const d_vector&                      fixed_lower          ,
          const d_vector&                      fixed_upper
     );

sample_random
sample_random , Simulation the Posterior Distribution for Random Effects.
     std::string sample_random(
          d_vector&            sample               ,
          const std::string&   random_ipopt_options ,
          const d_vector&      fixed_vec            ,
          const d_vector&      random_lower         ,
          const d_vector&      random_upper         ,
          const d_vector&      random_in
     );

information_mat, Deprecated 2020-03-22
information_mat , Compute the Observed Information For Fixed Effects.
     d_sparse_rcv information_mat(
          const CppAD::mixed::fixed_solution&  solution             ,
          const d_vector&                      random_opt
     );

Contents
derived_ctorUser Defined Class Derived From cppad_mixed
ran_likelihoodUser Defined Random Likelihood Function
fix_likelihoodUser Defined Fixed Likelihood Function
fix_constraintUser Defined Fixed Effects Constraint Function
initializeInitialization After Constructor
optimize_randomOptimize Random Effects
optimize_fixedOptimize Fixed Effects
hes_fixed_objCompute the Hessian of The Fixed Effects Objective
hes_random_objCompute the Hessian of The Random Effects Objective
sample_fixedSample Posterior for Fixed Effects
sample_randomSimulation the Posterior Distribution for Random Effects
information_matCompute the Observed Information For Fixed Effects

Input File: include/cppad/mixed/base_class.hpp