Patterns in static

Apophenia

Data Structures | Macros | Typedefs | Functions | Variables
apop_mle.c File Reference

Data Structures

struct  grad_params
 
struct  infostruct
 
struct  apop_model_for_infomatrix_struct
 

Macros

#define Onecheck(str)   if (!strcasecmp(m, #str)) return 0;
 

Typedefs

typedef long double(* apop_fn_with_params )(apop_data *, apop_model *)
 
typedef void(* apop_df_with_void )(const gsl_vector *beta, void *d, gsl_vector *gradient)
 
typedef void(* apop_fdf_with_void )(const gsl_vector *beta, void *d, double *f, gsl_vector *df)
 

Functions

 Apop_settings_copy (Apop_settings_free(apop_parts_wanted)
 
gsl_vector * apop_numerical_gradient (apop_data *data, apop_model *model, double delta)
 
apop_dataapop_model_hessian (apop_data *data, apop_model *model, double delta)
 
apop_dataapop_model_numerical_covariance (apop_data *data, apop_model *model, double delta)
 
void add_info_criteria (apop_data *d, apop_model *m, apop_model *est, double ll, int param_ct)
 
void get_desires (apop_model *m, infostruct *info)
 
int check_method (char *m)
 
void apop_maximum_likelihood (apop_data *data, apop_model *dist)
 
apop_modelapop_estimate_restart (apop_model *e, apop_model *copy, char *starting_pt, double boundary)
 

Variables

double default_delta = 1e-3
 
apop_modelapop_model_for_infomatrix
 
jmp_buf anneal_jump
 

Detailed Description

The MLE functions. Call them with an apop_model.

This file includes a number of distributions and models whose parameters one would estimate using maximum likelihood techniques.

It has (more-or-less) a single public function: apop_maximum_likelihood, and you don't even need to use that one, because the apop_estimate function defaults to using it if there is no model-specific estimation routine provided.

At the bottom are the maximum likelihood procedures themselves. There are four: Newton-type derivative methods, the no-derivative version, the with-derivative version, and the simulated annealing routine.

Function Documentation

apop_data* apop_model_hessian ( apop_data data,
apop_model model,
double  delta 
)

Numerically estimate the matrix of second derivatives of the parameter values. The math is simply a series of re-evaluations at small differential steps. [Therefore, it may be expensive to do this for a very computationally-intensive model.]

Parameters
dataThe data at which the model was estimated
modelThe model, with parameters already estimated
deltathe step size for the differentials. The current default is around 1e-3.
Returns
The matrix of estimated second derivatives at the given data and parameter values.
apop_data* apop_model_numerical_covariance ( apop_data data,
apop_model model,
double  delta 
)

Produce the covariance matrix for the parameters of an estimated model via the derivative of the score function at the parameter. I.e., I find the second derivative via apop_model_hessian , and take the negation of the inverse.

I follow Efron and Hinkley in using the estimated information matrix—the value of the information matrix at the estimated value of the score—not the expected information matrix that is the integral over all possible data. See Pawitan 2001 (who cribbed a little off of Efron and Hinkley) or Klemens 2008 (who directly cribbed off of both) for further details.

Parameters
dataThe data by which your model was estimated
modelA model whose parameters have been estimated.
deltaThe differential by which to step for sampling changes. (default currently = 1e-3)
Returns
A covariance matrix for the data. Also, if the data does not have a "Covariance" page, I'll set it to the result as well [i.e., I won't overwrite an existing covar].

This function uses the Designated initializers syntax for inputs.

Variable Documentation

apop_model* apop_model_for_infomatrix
Initial value:
= &(apop_model){"Ad hoc model for working out the information matrix.",
.log_likelihood = apop_fn_for_infomatrix}
struct apop_model apop_model
Definition: apop.h:99

Autogenerated by doxygen on Wed Oct 15 2014 (Debian 0.999b+ds3-2).