mfe_loadf_plotcomp.m

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

M
52
字号
function mfe_loadf_plotcomp(L,perc,stochc,cal_beg_i,cal_end_i,obj);
%MFE_LOADF_PLOTCOMP Auxiliary routine for MFE_LOADF.
%	MFE_LOADF_PLOTCOMP(L,PERC,STOCHC,CAL_BEG_I,CAL_END_I,OBJ) plots the 
%   seasonal and stochastic components of Models A and B. 
%
%   Input data:
%       L - load data vector,
%       PERC - seasonal (deterministic) component,
%       STOCHC - stochastic component,
%       CAL_BEG_I - index of the first value of the calibration period,
%       CAL_END_I - index of the last value of the calibration period,
%       OBJ - 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 get(obj.modela,'value')
    h12 = figure(12);
    set(h12,'name','Components of Model A','numbertitle','off');
else
    h13 = figure(13);
    set(h13,'name','Components of Model B','numbertitle','off');
end;    

cal_period = 1+cal_end_i-cal_beg_i;
if any(perc)
    subplot(3,1,1)
    plot(1:cal_period,L(cal_beg_i:cal_end_i))
    set(gca,'xlim',[0.5,cal_period+0.5],'ylim',[0.9*min(L(1:cal_period)),1.1*max(L(1:cal_period))])
    title('System-wide load')
    subplot(3,1,2)
    plot(1:cal_period,perc(1:cal_period))
    set(gca,'xlim',[0.5,cal_period+0.5],'ylim',[0.9*min(perc(1:cal_period)),1.1*max(perc(1:cal_period))])
    title('Seasonal (deterministic) component')
    subplot(3,1,3)
    plot(1:cal_period,stochc(1:cal_period))
    set(gca,'xlim',[0.5,cal_period+0.5],'ylim',[1.1*min(stochc(1:cal_period)),1.1*max(stochc(1:cal_period))])
    title('Stochastic component')
else
    subplot(3,1,1)
    plot(1:cal_period,L(cal_beg_i:cal_end_i))
    set(gca,'xlim',[0.5,cal_period+0.5],'ylim',[0.9*min(L(1:cal_period)),1.1*max(L(1:cal_period))])
    title('System-wide load')
    subplot(3,1,2)
    plot(1:cal_period-1,logret(L(cal_beg_i:cal_end_i)))
    set(gca,'xlim',[0.5,cal_period-0.5],'ylim',[1.1*min(logret(L(1:cal_period))),1.1*max(logret(L(1:cal_period)))])
    title('System-wide load returns')
    subplot(3,1,3)
    plot(1:cal_period-1,stochc(1:cal_period-1))
    set(gca,'xlim',[0.5,cal_period-0.5],'ylim',[1.1*min(stochc(1:cal_period-1)),1.1*max(stochc(1:cal_period-1))])
    title('Stochastic component')
end;

⌨️ 快捷键说明

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