![]() |
|
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_data * | apop_model_hessian (apop_data *data, apop_model *model, double delta) |
apop_data * | apop_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_model * | apop_estimate_restart (apop_model *e, apop_model *copy, char *starting_pt, double boundary) |
Variables | |
double | default_delta = 1e-3 |
apop_model * | apop_model_for_infomatrix |
jmp_buf | anneal_jump |
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.
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.]
data | The data at which the model was estimated |
model | The model, with parameters already estimated |
delta | the step size for the differentials. The current default is around 1e-3. |
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.
data | The data by which your model was estimated |
model | A model whose parameters have been estimated. |
delta | The differential by which to step for sampling changes. (default currently = 1e-3) |
"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.
apop_model* apop_model_for_infomatrix |