function value = eco561arma(b, y, p, q);
%Define a separate matlab function to do minimization
mu = b(1);
%Extract mu
phi = b(2:1+p);
%Extract phi
arroots = roots([1; -phi]);
%Calculate the inverted AR roots
absarroots = abs(arroots);
%Calculate the abso
(1) Phi1=0.2729 Phi2=0.2367 Phi3= 0.3916.
(2) According to the plot for residuals we cannot observe some pattern from it.
So the residual series et likely to be generated from a white noise process.
(3) According to the plot, most of the first 36 sample a
function partial = eco561partial(rho);
%Define a separate matlab function to calculate partial autocorrelations from autocorrelations
rhomatrix = zeros(length(rho), length(rho);
%Allocate a matrix to store the sample autocorrelations
for i = 1:length(rho)
function value = eco561ma(b, y, q);
%Define a separate matlab function to do minimization
mu = b(1);
%Extract mu
theta = b(2:end);
%Extract theta
maroots = roots([1; theta]);
%Calculate the inverted MA roots
absmaroots = abs(maroots);
%Calculate the abso
function eco561chpt7
%Define a matlab function
%Chapter 7, realizations of two MA(1) processes
epsilon = randn(151, 1);
%Simulate draws from a Gaussian white noise process
y1 = epsilon(2:end)+0.4*epsilon(1:end-1);
%Construct the series one
y2 = epsilon(2:
function eco561chpt6
%Define a matlab function
%Chapter 6, realization of white noise process
epsilon = randn(150, 1);
%Simulate draws from a Gaussian white noise process
y = epsilon;
%Construct the series
figure;
%Create the figure.
plot(1:length(y), y);
function eco561chpt5
%Define a matlab function
%Chapter 5, liquor sales
data = load('LIQUOR.DAT', '-ascii');
%Read the data set called `LIQUOR.DAT' in ascii form.
figure;
%Create the figure.
plot(80+1/12:1/12:92+1/12, data(157:301);
%Plot the series
title
function [rho, qlb, partial] = eco561auto(series, tau);
%Define a separate matlab function to calculate sample autocorrelations, Ljung-box Q-statistic, and sample partial autocorrelations
rho = zeros(tau, 1);
%Allocate a vector to store the sample autocor
1. The assumption is not reasonable. Since from residual plot, we still
can observe some pattern.
2. Yes, we can use sample autocorrelation and sample partial
autocorrelation to see the distribution: () N(0, 1T) and check
whether the sample autocorrelatio
1.
2.
If T goes to infinity, there will be no differences between the sample autocorrelations
and partial autocorrelations plotted in question 2 and their population counterparts
shown in question 1.
Since for 1
(1) 1 0 1
P(1) 1
1
0
0.95
1 1 2 10.9025