|
TPCCLIB
|
Routines for model selection and weighting using Akaike's information criteria. More...
#include "libtpcmodel.h"Go to the source code of this file.
Functions | |
| double | aicSS (double ss, const int n, const int k) |
| int | parFreeNr (const int n, double *pLower, double *pUpper) |
| Calculate the number of free parameters. | |
| int | aicWeights (double *aic, double *w, int n) |
| double | aicWeightedAvg (double *w, double *p, int n) |
| double | aicModel (double *w, int n) |
Routines for model selection and weighting using Akaike's information criteria.
https://www.turkupetcentre.net/reports/tpcmod0016.pdf
Definition in file aic.c.
| double aicModel | ( | double * | w, |
| int | n ) |
Calculates a value describing the relative goodness of models, based on an array of model weights.
| w | Array of weights |
| n | Length of array |
Definition at line 132 of file aic.c.
| double aicSS | ( | double | ss, |
| const int | n, | ||
| const int | k ) |
Computation of AICc in the special case of sum-of-squares optimization from the SS, nr of fitted points and nr of fitted parameters.
If variance is different between the data points, weighted SS must be given.
| ss | Sum-of-Squares of the fit |
| n | Sample size, i.e. nr of fitted data points |
| k | Number of fitted model parameters; AICc calculation is valid only when (n-k)>1. |
Definition at line 20 of file aic.c.
Referenced by imgNoiseTemplate().
| double aicWeightedAvg | ( | double * | w, |
| double * | p, | ||
| int | n ) |
Computation of the Akaike weighted model parameter average. Requires arrays of AIC weight values, and corresponding parameter values.
| w | Array of weights |
| p | Array of parameters |
| n | Lengths of arrays |
Definition at line 108 of file aic.c.
| int aicWeights | ( | double * | aic, |
| double * | w, | ||
| int | n ) |
Computation of the Akaike weights for model averaging. Requires an array of AIC values, and an output array for weights.
| aic | Array of AICs |
| w | Array of weights (output) |
| n | Lengths of arrays |
Definition at line 74 of file aic.c.
| int parFreeNr | ( | const int | n, |
| double * | pLower, | ||
| double * | pUpper ) |
Calculate the number of free parameters.
Model parameters can be fixed by setting lower and upper limit to equal values. This function simply checks the limits for each parameter.
| n | Nr of parameters |
| pLower | Lower limits (array of length n) |
| pUpper | Upper limits (array of length n) |
Definition at line 50 of file aic.c.