⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 armaacvf.m

📁 Modeling and Forecasting Electricity Loads and Prices: A Statistical Approach" by Rafa&#322 Weron, p
💻 M
字号:
function CV=armaacvf(ar,ma,n);
%ARMAACVF Autocovariance function of an ARMA process.
%   CV=ARMAACVF(AR,MA,N) returns N+1 values of the theoretical 
%   autocovariance function of an ARMA process with autoregressive and 
%   moving average coefficients given by vectors AR=[1,a_1,...,a_p] and 
%   MA=[1,b_1,...,b_q], respectively. 
%
%   Reference(s):
%   [1] P.J.Brockwell, R.A.Davis (1991) 'Time Series: Theory and Methods', 
%   (2nd edn), Springer-Verlag, New York.

%   Written by Adam Misiorek and Rafal Weron (2006.09.16)
%   Copyright (c) 2006 by Rafal Weron

% Define AR and MA orders; in fact p and q are really p+1 and q+1,
% respectively
p = length(ar);
q = length(ma);
pp = max(p,q+1);
ar = [ar zeros(1,pp-p)];

mac = zeros(pp);
vec1 = zeros(pp,1);

% Compute coefficients of an MA(inf) process corresponding to ARMA(ar,ma)
vec2 = mainfcoeff(ar,ma,q)';

% Compute autocovariance
for i = 1:pp
    for j = 1:pp
        mac(i,abs(j-i)+1) = mac(i,abs(j-i)+1)+ar(j);
    end;        
    vec1(i) = ma(i:q)*vec2(1:q-i+1);
end;
CV = mac\vec1;
for i = pp+1:n+1
    CV = [CV;-ar(2:p)*CV(end:-1:end-p+2)];
end;
CV = CV(1:n+1);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -