Mercurial > hg > octave-nkf
diff scripts/signal/arch_test.m @ 11469:c776f063fefe
Overhaul m-script files to use common variable name between code and documentation.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Sun, 09 Jan 2011 12:41:21 -0800 |
parents | e00de2d5263c |
children | 1740012184f9 |
line wrap: on
line diff
--- a/scripts/signal/arch_test.m +++ b/scripts/signal/arch_test.m @@ -66,7 +66,7 @@ ## Author: KH <Kurt.Hornik@wu-wien.ac.at> ## Description: Test for conditional heteroscedascity -function [pval, lm] = arch_test (y, X, p) +function [pval, lm] = arch_test (y, x, p) if (nargin != 3) error ("arch_test: 3 input arguments required"); @@ -77,9 +77,9 @@ endif T = length (y); y = reshape (y, T, 1); - [rx, cx] = size (X); + [rx, cx] = size (x); if ((rx == 1) && (cx == 1)) - X = autoreg_matrix (y, X); + x = autoreg_matrix (y, x); elseif (! (rx == T)) error ("arch_test: either rows(X) == length(y), or X is a scalar"); endif @@ -87,7 +87,7 @@ error ("arch_test: p must be a positive integer"); endif - [b, v_b, e] = ols (y, X); + [b, v_b, e] = ols (y, x); Z = autoreg_matrix (e.^2, p); f = e.^2 / v_b - ones (T, 1); f = Z' * f;