fix_likelihood

View page source

User Defined Fixed Likelihood Function

Syntax

vec = mixed_object . fix_likelihood ( fixed_vec )

mixed_object

We use mixed_object to denote an object of a class that is derived from the cppad_mixed base class.

a1_double

see a1_double .

Virtual Function

The following virtual function may be implemented in the derived class:

      virtual CppAD::vector<a1_double> fix_likelihood (
            const CppAD::vector<a1_double>& fixed_vec
      )

fixed_vec

This argument has prototype

const CppAD::vector<a1_double>& fixed_vec

It contains a value for the fixed effects vector.

vec

This result has prototype

CppAD::vector< a1_double > vec

It is a Negative Log-Density Vector corresponding to the fixed likelihood g(theta) where

\[g( \theta ) = - \log [ \B{p} ( z | \theta ) \B{p} ( \theta ) ]\]

constant

Adding or subtracting a constant to vec [0] , that does not depend on the fixed effects \(\theta\), does not affect the optimal estimates for the fixed or random effects.

Default

The base class definition (default) for fix_likelihood returns an empty vector; i.e., vec . size () == 0 . This corresponds to the case where:

  1. All of the data depends on the random effects; i.e., the data vector z is empty.

  2. There is no prior p(theta) for the fixed effects.

Example

The file fix_likelihood.cpp contains an example and test of defining this virtual function. It returns true, if the test passes, and false otherwise.