diff options
Diffstat (limited to 'macros/arch_rnd.sci')
-rw-r--r-- | macros/arch_rnd.sci | 30 |
1 files changed, 2 insertions, 28 deletions
diff --git a/macros/arch_rnd.sci b/macros/arch_rnd.sci index 9e3d88c..dafe6c2 100644 --- a/macros/arch_rnd.sci +++ b/macros/arch_rnd.sci @@ -1,23 +1,19 @@ -//Simulate an ARCH sequence of length t with AR coefficients b and CH coefficients a. +function y = arch_rnd (a, b, t) +//Simulate an ARCH sequence of length t with AR coefficients b and CH coefficients a. //Calling Sequence //arch_rnd (a, b, t) - //Parameters //a: CH coefficients //b: AR coefficients //t: Length of ARCH sequence - //Description //This is an Octave function. //It Simulates an ARCH sequence of length t with AR coefficients b and CH coefficients a. //The result y(t) follows the model -// //y(t) = b(1) + b(2) * y(t-1) + … + b(lb) * y(t-lb+1) + e(t), //where e(t), given y up to time t-1, is N(0, h(t)), with -// //h(t) = a(1) + a(2) * e(t-1)^2 + … + a(la) * e(t-la+1)^2 - //Examples //a = [1 2 3 4 5]; //b = [7 8 9 10]; @@ -25,34 +21,12 @@ //arch_rnd (a, b, t) //Output // ans = -// // 7.2113249 // 65.479684 // 654.00814 // 7194.6572 // 78364.905 - - -//function res = arch_rnd (a, b, t) -//funcprot(0); -//lhs = argn(1) -//rhs = argn(2) -//if (rhs < 3 | rhs > 3) -//error("Wrong number of input arguments.") -//end -// -//select(rhs) -// -// case 3 then -// res = callOctave("arch_rnd",a, b, t) -// -// end -//endfunction - - -function y = arch_rnd (a, b, t) - funcprot(0); [nargout, nargin] = argn() ; |