TimeSeriesSRC.pmodbic

TimeSeriesSRC.pmodbic(pmod, y, u=[])

Compute the Bayesian Information Criterion (BIC) for a fitted model.

\[\text{BIC} = \ln(\text{MSE}) + \frac{k \ln N}{N}\]

where \(k\) is the number of free parameters and \(N\) is the number of data points. BIC penalises model complexity more strongly than AIC for large \(N\). Lower BIC indicates a better model.

Parameters:
  • pmod (pmodel) – Fitted prediction model.

  • y (array-like) – Desired output sequence.

  • u (array-like, optional) – Input sequence. Default [].

Returns:

bic – Bayesian Information Criterion.

Return type:

float

Examples

>>> import pathlib, pandas as pd
>>> import TimeSeriesSRC as ts
>>> data_dir = pathlib.Path(ts.__file__).parent / 'TestData'
>>> y = pd.read_csv(data_dir / 'Series_A_Chemical_Concentration.csv').values.flatten()
>>> pm = ts.pmodel('arma', nc=[1], nd=[1], diff=[0], per=[])
>>> pm_est, trec, stat = ts.estimate(pm, y, show_plot=False, show_output=False)
>>> bic = ts.pmodbic(pm_est, y)

See also

pmodaic

Akaike Information Criterion.

selpmod

Automatic model selection using AIC/BIC grid search.