github.com/RhysU/ar
Autoregressive process modeling tools in header-only C++
Public Types | Static Public Member Functions | List of all members
ar::best_model_function< EstimationMethod, Integer1, Integer2, Sequence1, Sequence2, Sequence3, Sequence4 > Struct Template Reference

A template typedef and helper method returning a best_model implementation matching a model selection criterion provided at runtime. More...

#include <ar.hpp>

Public Types

typedef Sequence1::difference_type(* type) (Integer1 N, Integer2 minorder, Sequence1 &params, Sequence2 &sigma2e, Sequence3 &gain, Sequence4 &autocor)
 The type returned by the lookup function.
 

Static Public Member Functions

static type lookup (const char *abbreviation, const bool subtract_mean)
 Lookup a best_model function pointer matching EstimationMethod, the specified criterion c abbreviation, and whether or not the sample mean has been subtracted from the data. More...
 
template<class CharT , class Traits , class Allocator >
static type lookup (std::basic_string< CharT, Traits, Allocator > abbreviation, const bool subtract_mean)
 Lookup a best_model function pointer matching EstimationMethod, the specified criterion c abbreviation, and whether or not the sample mean has been subtracted from the data. More...
 

Detailed Description

template<template< class > class EstimationMethod, typename Integer1, typename Integer2, class Sequence1, class Sequence2 = Sequence1, class Sequence3 = Sequence2, class Sequence4 = Sequence3>
struct ar::best_model_function< EstimationMethod, Integer1, Integer2, Sequence1, Sequence2, Sequence3, Sequence4 >

A template typedef and helper method returning a best_model implementation matching a model selection criterion provided at runtime.

Intended for use within interactive APIs, this method handles much of the ugliness of resolving overloaded criterion logic and accounting for which methods care as to whether or not the sample mean has been subtracted. Class template parameters should be set to match the desired overload returned by the lookup method.

Methods are looked up using their abbreviations as follows:

AIC
Akaike information criterion
AICC
asymptotically-corrected Akaike information criterion
BIC
consistent criterion BIC
CIC
combined information criterion
FIC
finite information criterion
FSIC
finite sample information criterion
GIC
generalized information criterion
MCC
minimally consistent criterion

Leading or trailing whitespace as well as capitalization differences are ignored.

Template Parameters
EstimationMethodOne of Burg, YuleWalker, LSFB, or LSF.
Integer1Per the Integer1 parameter of best_model
Integer2Per the Integer2 parameter of best_model
Sequence1Per the Sequence1 parameter of best_model
Sequence2Per the Sequence2 parameter of best_model
Sequence3Per the Sequence3 parameter of best_model
Sequence4Per the Sequence4 parameter of best_model

Definition at line 2515 of file ar.hpp.

Member Function Documentation

◆ lookup() [1/2]

template<template< class > class EstimationMethod, typename Integer1 , typename Integer2 , class Sequence1 , class Sequence2 = Sequence1, class Sequence3 = Sequence2, class Sequence4 = Sequence3>
static type ar::best_model_function< EstimationMethod, Integer1, Integer2, Sequence1, Sequence2, Sequence3, Sequence4 >::lookup ( const char *  abbreviation,
const bool  subtract_mean 
)
inlinestatic

Lookup a best_model function pointer matching EstimationMethod, the specified criterion c abbreviation, and whether or not the sample mean has been subtracted from the data.

Parameters
abbreviationKnown abbreviations per best_model_function. If only whitespace, a reasonable default is used.
subtract_meanHas the sample mean been subtracted from the data?
Returns
A function pointer which, when invoked, calls best_model. When no known criterion matches abbreviation, NULL is returned.

Definition at line 2559 of file ar.hpp.

References ar::best_model_function< EstimationMethod, Integer1, Integer2, Sequence1, Sequence2, Sequence3, Sequence4 >::lookup().

◆ lookup() [2/2]

template<template< class > class EstimationMethod, typename Integer1 , typename Integer2 , class Sequence1 , class Sequence2 , class Sequence3 , class Sequence4 >
template<class CharT , class Traits , class Allocator >
best_model_function< EstimationMethod, Integer1, Integer2, Sequence1, Sequence2, Sequence3, Sequence4 >::type ar::best_model_function< EstimationMethod, Integer1, Integer2, Sequence1, Sequence2, Sequence3, Sequence4 >::lookup ( std::basic_string< CharT, Traits, Allocator >  abbreviation,
const bool  subtract_mean 
)
static

Lookup a best_model function pointer matching EstimationMethod, the specified criterion c abbreviation, and whether or not the sample mean has been subtracted from the data.

Parameters
abbreviationKnown abbreviations per best_model_function. If only whitespace, a reasonable default is used.
subtract_meanHas the sample mean been subtracted from the data?
Template Parameters
CharTPermits use by any std::basic_string instantiation
TraitsPermits use by any std::basic_string instantiation
AllocatorPermits use by any std::basic_string instantiation
Returns
A function pointer which, when invoked, calls best_model. When no known criterion matches abbreviation, NULL is returned.

Definition at line 2579 of file ar.hpp.


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