Be the first to rate this file! 140 downloads (last 30 days) File Size: 1.34 KB File ID: #20496

armodelcov

by Aslak Grinsted

 

27 Jun 2008 (Updated 30 Jun 2008)

No BSD License  

Calculates the process autocovariance of an autoregressive model.

Download Now | Watch this File

File Information
Description

Calculates the process autocovariance of an autoregressive model.
 
  USAGE:
  C=armodelcov(a)
 
  a: A row vector with AR coefficients.
     The notation follows that of other matlab functions such as arburg & filter.
     Note: this notation is different from what is commonly found in textbooks
           (sign is different and the length is one longer)
           x(t)=sum(-a(2:end).*x(t-(1:length(a)-1)))+randn;
  C: autocovariance matrix of same order as the ar model.
 
  Assumes that the noise term is IID gaussian noise (zero mean, unit stddev)
 
 
  EXAMPLE:
  ------------
  a=[1.0 -0.5 0.2 -0.0 -0.0 0.2 -0.5];
  n=length(a)-1;
  C_theory=armodelcov(a);
  C_theory=C_theory(:,1)'
  
  %generate noise according to the ar model and check what kind of autocov. it has.
  noise=filter(1,a,randn(10000,1));
  noise(1:100)=[]; %cut away edge effects.
  C_noise=xcov(noise,7,'unbiased')';
  C_noise(1:n)=[]

MATLAB release MATLAB 7 (R14)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Updates
30 Jun 2008

use \ instead of inv

Tag Activity for this File
Tag Applied By Date/Time
statistics Aslak Grinsted 22 Oct 2008 10:07:42
probability Aslak Grinsted 22 Oct 2008 10:07:42
autoregressive Aslak Grinsted 22 Oct 2008 10:07:42
variance Aslak Grinsted 22 Oct 2008 10:07:42
autocorrelation Aslak Grinsted 22 Oct 2008 10:07:42
model Aslak Grinsted 22 Oct 2008 10:07:42
autocovariance Aslak Grinsted 22 Oct 2008 10:07:42
ar Aslak Grinsted 22 Oct 2008 10:07:42
autocorrelation Chandan Mishra 30 Jan 2009 00:33:03
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com