FIMS  v0.8.1
Loading...
Searching...
No Matches
fims_distributions::DensityComponentBase< Type > Struct Template Referenceabstract

Base class for all module_name functors. More...

#include <density_components_base.hpp>

Inheritance diagram for fims_distributions::DensityComponentBase< Type >:
fims_model_object::FIMSObject< Type > fims_distributions::LogNormalLPDF< Type > fims_distributions::MultinomialLPMF< Type > fims_distributions::NormalLPDF< Type >

Public Member Functions

Typeget_observed (size_t i)
 Retrieve one observed value based on input_type.
 
Typeget_observed (size_t i, size_t j)
 Retrieve one observed matrix-like value based on input_type.
 
Typeget_expected (size_t i)
 Retrieve one expected value based on input_type and use_mean.
 
size_t get_n_x ()
 Get length of the active observed input vector.
 
size_t get_n_expected ()
 Get length of the active expected input vector.
 
 DensityComponentBase ()
 Constructor, which initializes default prior pointer state and ID.
 
virtual const Type evaluate ()=0
 Evaluate the distribution-specific log-likelihood contribution.
 
- Public Member Functions inherited from fims_model_object::FIMSObject< Type >
uint32_t GetId () const
 Getter that returns the unique id for parameters in the model.
 
bool CheckDimensions (size_t actual, size_t expected)
 Check the dimensions of an object.
 

Public Attributes

std::string input_type
 Classification of the input pathway for this distribution object. Options used by accessor methods are, "prior", "random_effects", and "data".
 
std::shared_ptr< fims_data_object::DataObject< Type > > data_observed_values
 Observed data.
 
fims::Vector< Typeexpected_values
 Expected value vector for prior-based pathways.
 
fims::Vector< Type > * re = NULL
 Pointer to random effects vector.
 
fims::Vector< Type > * re_expected_values = NULL
 Expected value vector for random-effects pathways.
 
fims::Vector< Type > * data_expected_values = NULL
 Expected value vector for data pathways.
 
std::vector< fims::Vector< Type > * > priors
 Vector of pointers where each entry points to a prior parameter.
 
fims::Vector< Typeobserved_values
 Input value of distribution function for priors or random effects.
 
fims::Vector< Typeexpected_mean
 The expected mean of the distribution; overrides expected values.
 
std::string use_mean = fims::to_string("no")
 If "yes", expected_mean is used instead of expected_values. The default is "no" leading to the use of expected_values.
 
Type lpdf
 Total log probability density contribution of the distribution.
 
int observed_data_id_m = -999
 ID of observed data component.
 
fims::Vector< Typelpdf_vec
 Vector storing observation-level log-likelihood contributions.
 
bool osa_flag = false
 Boolean; if true, one-step-ahead (OSA) residuals are calculated.
 
bool simulate_flag = false
 Boolean; if true, data are simulated from the distribution.
 
std::vector< uint32_tkey
 Unique ID for variable map that points to a fims::Vector.
 
- Public Attributes inherited from fims_model_object::FIMSObject< Type >
uint32_t id
 
std::vector< Type * > parameters
 
std::vector< Type * > random_effects_parameters
 
std::vector< Type * > fixed_effects_parameters
 

Static Public Attributes

static uint32_t id_g = 0
 Global unique identifier for distribution modules.
 

Detailed Description

template<typename Type>
struct fims_distributions::DensityComponentBase< Type >

Base class for all module_name functors.

Template Parameters
TypeThe type of the module_name functor.

Member Function Documentation

◆ evaluate()

template<typename Type >
virtual const Type fims_distributions::DensityComponentBase< Type >::evaluate ( )
pure virtual

Evaluate the distribution-specific log-likelihood contribution.

Returns
Total log-likelihood contribution for the active inputs.

Implemented in fims_distributions::LogNormalLPDF< Type >, fims_distributions::MultinomialLPMF< Type >, and fims_distributions::NormalLPDF< Type >.

◆ get_expected()

template<typename Type >
Type & fims_distributions::DensityComponentBase< Type >::get_expected ( size_t  i)
inline

Retrieve one expected value based on input_type and use_mean.

Parameters
iIndex into the active expected source, e.g., vector or pointer.
Returns
Reference to the selected expected value.

If use_mean == "yes", expected_mean overrides other expected vectors and is accessed via scalar/vector semantics.

◆ get_n_expected()

template<typename Type >
size_t fims_distributions::DensityComponentBase< Type >::get_n_expected ( )
inline

Get length of the active expected input vector.

Returns
Size of the expected input under the current input_type.

◆ get_n_x()

Get length of the active observed input vector.

Returns
Size of the observed input under the current input_type.

◆ get_observed() [1/2]

template<typename Type >
Type & fims_distributions::DensityComponentBase< Type >::get_observed ( size_t  i)
inline

Retrieve one observed value based on input_type.

Parameters
iIndex into the active observed source, e.g., vector or pointer.
Returns
Reference to the selected observed value.
Exceptions
std::runtime_errorIf input_type is "prior" and priors is empty.

◆ get_observed() [2/2]

template<typename Type >
Type & fims_distributions::DensityComponentBase< Type >::get_observed ( size_t  i,
size_t  j 
)
inline

Retrieve one observed matrix-like value based on input_type.

Parameters
iRow index.
jColumn index.
Returns
Reference to the selected observed value.

Member Data Documentation

◆ id_g

Global unique identifier for distribution modules.

Default id of the singleton distribution class.


The documentation for this struct was generated from the following file: