# HG changeset patch # User John W. Eaton # Date 1328632893 18000 # Node ID 2cd56a5e3a66f70336e91269adf311d6606a5a68 # Parent 71efccec5936686eaf08af4dab302a7f921d736e new tests * ols.m: New tests. diff -r 71efccec5936 -r 2cd56a5e3a66 scripts/statistics/base/ols.m --- a/scripts/statistics/base/ols.m Tue Feb 07 11:34:55 2012 -0500 +++ b/scripts/statistics/base/ols.m Tue Feb 07 11:41:33 2012 -0500 @@ -141,6 +141,27 @@ %! x = [x, ones(5,1)]; %! assert (ols(y,x), [3; 2], 50*eps) +%!test +%! x = [1, 2; 3, 4]; +%! y = [1; 2]; +%! [b, s, r] = ols (x, y); +%! assert (b, [1.4, 2], 2*eps); +%! assert (s, [0.2, 0; 0, 0], 2*eps); +%! assert (r, [-0.4, 0; 0.2, 0], 2*eps); + +%!test +%! x = [1, 2; 3, 4]; +%! y = [1; 2]; +%! [b, s] = ols (x, y); +%! assert (b, [1.4, 2], 2*eps); +%! assert (s, [0.2, 0; 0, 0], 2*eps); + +%!test +%! x = [1, 2; 3, 4]; +%! y = [1; 2]; +%! b = ols (x, y); +%! assert (b, [1.4, 2], 2*eps); + %% Test input validation %!error ols (); %!error ols (1);