From: Aino on
Dear all,

I need to model my data with AR model and estimate the appropriate model order with Schwarz's Bayesian Criterion (or Bayesian Information Criterion, BIC). I found a function aicbic that is supposed to do this, but it needs two input parameters (LLF and NumParams) that led me to other more complex models and their functions (garchfit, garchinfer, vgxvarx, garchcount, vgxcount)... I don't know if these can be used to model with AR model.

On the other hand, the BIC is easy to calculate if you know the least squares fit error, but the usual AR-model function, AR, doesn't seem to give it and I don't know where to get it.. The BIC is:

BIC(p)=log(Sigma^2/N)+p/N*log(N),

where Sigma is the model error (least squares fit by solving the Yule-Walker equations), N is the number of data points in the signal, p is the model order.

So, could anyone please tell me if there is an easy way to either get the Sigma or to calculate the BIC?

Thank You,
Aino


From: Aino on
Hi all,

I found another function to calculate the AR model: aryule. Am I right if I say that BIC can be calculated as easily as:

p=3;%model order
y=....;%whatever signal..
N=length(y);
[~, NoiseVariance] = aryule(y,p);
BIC=log(NoiseVariance)+p/N*log(N);

Thank you,
Aino