mfe_loadf_plotacf.m

来自「Modeling and Forecasting Electricity Loa」· M 代码 · 共 46 行

M
46
字号
function mfe_loadf_plotacf(stochc,obj,N);
%MFE_LOADF_PLOTACF Auxiliary routine for MFE_LOADF.
%	MFE_LOADF_PLOTACF(STOCHC,OBJ,N) plots autocorrelation (ACF) and partial 
%   autocorrelation (PACF) functions for the stochastic component STOCHC.
%   The maximum lag is given by N. OBJ is a handle to the radiobuttons used
%   to select between the models.

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

if nargin<3
    N = 28;
end;
if get(obj.modela,'value')
    h16 = figure(16);
    set(h16,'name','Autocorrelation of Model A stochastic component','numbertitle','off');
else
    h17 = figure(17);
    set(h17,'name','Autocorrelation of Model B stochastic component','numbertitle','off');
end;    

% ACF
subplot(2,1,1);
[ya,xa,ba] = autocorr(stochc,N);
lineHandles = stem(xa,ya,'filled','r-o');
set(lineHandles(1),'MarkerSize',4)
grid on
xlabel('Time lag [Days]')
ylabel('ACF')
set(gca,'xlim',[0,N]);
hold on
plot([0.5 0.5;N N],[ba([1 1]) ba([2 2])],'-b');
hold off

% PACF
subplot(2,1,2);
[ya,xa,ba] = parcorr(stochc,N);
lineHandles = stem(xa,ya,'filled','r-o');
set(lineHandles(1),'MarkerSize',4)
grid on
xlabel('Time lag [Days]')
ylabel('PACF')
set(gca,'xlim',[0,N]);
hold on
plot([0.5 0.5;N N],[ba([1 1]) ba([2 2])],'-b');
hold off

⌨️ 快捷键说明

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