From b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b Mon Sep 17 00:00:00 2001 From: priyanka Date: Wed, 24 Jun 2015 15:03:17 +0530 Subject: initial commit / add all books --- 2048/CH6/EX6.13/arma_ex.sce | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100755 2048/CH6/EX6.13/arma_ex.sce (limited to '2048/CH6/EX6.13/arma_ex.sce') diff --git a/2048/CH6/EX6.13/arma_ex.sce b/2048/CH6/EX6.13/arma_ex.sce new file mode 100755 index 000000000..9a90baaae --- /dev/null +++ b/2048/CH6/EX6.13/arma_ex.sce @@ -0,0 +1,39 @@ +// Implementation of trial and error procedure to determine ARMA(1,1) process, presented in Example 6.20 on page 191. +// 6.13 + +exec('plotacf.sci',-1); +exec('pacf.sci',-1); +exec('label.sci',-1); + +// Set up the model for simulation +arma_mod = armac([1 -0.8],0,[1 -0.3],1,1,1); + +// Generate the inputs for simulation +// Deterministic Input can be anything +u = zeros(1,2048); +e = rand(1,2048,'normal'); + +// Simulate the model +v = arsimul(arma_mod,[u e]); + +// Plot ACF and PACF for 10 lags +plotacf(v,1e-03,11,1); +xset('window',1), pacf(v,10); + +// Estimate AR(1) model and present it +// compute the residuals +[mod_est1,err_mod1] = armax1(1,0,0,v,zeros(1,length(v))); +disp(mod_est1); + +// Plot ACF and PACF for 10 lags +xset('window',2), plotacf(err_mod1,1e-03,11,1); +xset('window',3), pacf(err_mod1,10); + +// Check ACF and PACF of residuals +[mod_est2,err_mod2] = armax1(1,0,1,v,zeros(1,length(v))); +disp(mod_est2); + +// Plot ACF and PACF for 10 lags +xset('window',4), plotacf(err_mod2,1e-03,11,1); +xset('window',5), pacf(err_mod2,10); + -- cgit