Mercurial > hg > octave-lyh
comparison scripts/signal/arch_test.m @ 11472:1740012184f9
Use uppercase for variable names in error() strings to match Info documentation. Only m-files done.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Sun, 09 Jan 2011 21:33:04 -0800 |
parents | c776f063fefe |
children | fd0a3ac60b0e |
comparison
equal
deleted
inserted
replaced
11471:994e2a93a8e2 | 11472:1740012184f9 |
---|---|
71 if (nargin != 3) | 71 if (nargin != 3) |
72 error ("arch_test: 3 input arguments required"); | 72 error ("arch_test: 3 input arguments required"); |
73 endif | 73 endif |
74 | 74 |
75 if (! (isvector (y))) | 75 if (! (isvector (y))) |
76 error ("arch_test: y must be a vector"); | 76 error ("arch_test: Y must be a vector"); |
77 endif | 77 endif |
78 T = length (y); | 78 T = length (y); |
79 y = reshape (y, T, 1); | 79 y = reshape (y, T, 1); |
80 [rx, cx] = size (x); | 80 [rx, cx] = size (x); |
81 if ((rx == 1) && (cx == 1)) | 81 if ((rx == 1) && (cx == 1)) |
82 x = autoreg_matrix (y, x); | 82 x = autoreg_matrix (y, x); |
83 elseif (! (rx == T)) | 83 elseif (! (rx == T)) |
84 error ("arch_test: either rows(X) == length(y), or X is a scalar"); | 84 error ("arch_test: either rows(X) == length(Y), or X is a scalar"); |
85 endif | 85 endif |
86 if (! (isscalar(p) && (rem(p, 1) == 0) && (p > 0))) | 86 if (! (isscalar(p) && (rem(p, 1) == 0) && (p > 0))) |
87 error ("arch_test: p must be a positive integer"); | 87 error ("arch_test: P must be a positive integer"); |
88 endif | 88 endif |
89 | 89 |
90 [b, v_b, e] = ols (y, x); | 90 [b, v_b, e] = ols (y, x); |
91 Z = autoreg_matrix (e.^2, p); | 91 Z = autoreg_matrix (e.^2, p); |
92 f = e.^2 / v_b - ones (T, 1); | 92 f = e.^2 / v_b - ones (T, 1); |