Mercurial > hg > octave-lyh
diff scripts/signal/arch_test.m @ 3457:e031284eea27
[project @ 2000-01-19 08:49:56 by jwe]
author | jwe |
---|---|
date | Wed, 19 Jan 2000 08:50:14 +0000 |
parents | 858695b3ed62 |
children | d25bc039237b |
line wrap: on
line diff
--- a/scripts/signal/arch_test.m +++ b/scripts/signal/arch_test.m @@ -60,8 +60,8 @@ ## If no output argument is given, the @var{p}-value is displayed. ## @end deftypefn -## Author: KH <Kurt.Hornik@ci.tuwien.ac.at> -## Description: Test for conditional heteroscedascity +## Author: KH <Kurt.Hornik@ci.tuwien.ac.at> +## Description: Test for conditional heteroscedascity function [pval, lm] = arch_test (y, X, p) @@ -69,20 +69,19 @@ error ("arch_test needs 3 input arguments"); endif - if !(is_vector (y)) - error ("arch_test: y must be a vector"); + if (! (is_vector (y))) + error ("arch_test: y must be a vector"); endif T = length (y); y = reshape (y, T, 1); [rx, cx] = size (X); if ((rx == 1) && (cx == 1)) X = autoreg_matrix (y, X); - elseif !(rx == T) - error (["arch_test: ", ... - "either rows(X) == length(y), or X is a scalar"]); + elseif (! (rx == T)) + error ("arch_test: either rows(X) == length(y), or X is a scalar"); endif - if !(is_scalar(p) && (rem(p, 1) == 0) && (p > 0)) - error ("arch_test: p must be a positive integer."); + if (! (is_scalar(p) && (rem(p, 1) == 0) && (p > 0))) + error ("arch_test: p must be a positive integer."); endif [b, v_b, e] = ols (y, X);