資源簡介
此算法為協(xié)整程序,利用matlab語言編寫,可直接進行數(shù)據(jù)分析(內(nèi)包含數(shù)據(jù)序列)
代碼片段和文件信息
clear;?close?all;?clc
%%%%Interest?Rate?Data
load?Data_Canada
Y?=?Data(:3:end);
figure
plot(datesY‘LineWidth‘2)
xlabel(‘Year‘)
ylabel(‘Percent‘)
names?=?series(3:end);
legend(names‘location‘‘NW‘)
title(‘{\bf?Canadian?Interest?Rates?1954-1994}‘)
axis?tight
grid?on
%%%%Pretest?for?the?Order?of?Integration
y1?=?Y(:1);?%?Short-term?rate
%?Levels?data:
fprintf(‘===?Test?y1?for?a?unit?root?===\n\n‘)
[h1pVal1]?=?adftest(y1‘model‘‘ARD‘)?%?Left-tail?probability
fprintf(‘\n===?Test?y1?for?stationarity?===\n\n‘)
[h0pVal0]?=?kpsstest(y1‘trend‘false)?%?Right-tail?probability
%?Differenced?data:
fprintf(‘\n===?Test?(1-L)y1?for?a?unit?root?===\n\n‘)
[h1DpVal1D]?=?adftest(diff(y1)‘model‘‘ARD‘)?%?Left-tail?probability
fprintf(‘\n===?Test?(1-L)y1?for?sta
評論
共有 條評論