Write and test a function for the Cholesky decomposition of a symmetric positive definite matrix. Test it on an arbitrary symmetric positive definite matrix, and verify that it works through multiplication or using R or matlab.
In a one-way ANOVA, we test the null hypothesis that the means of several
different groups are all equal to each other. Let represent
the th observation in the th group, with
and
. Then a suitable test statistic for the
null hypothesis is:
Under the null hypothesis of the means being equal for all k groups, the statistic follows the F-distribution with and degrees of freedom.
Write and test a function for the Gram-Schmidt orthogonalization of an arbitrary matrix. Test it on a matrix of your choice, and verify that it works either through multiplication or using R or matlab.
Write a program which takes as input a matrix of and values and
then performs a regression using the function for Gram-Schmidt
orthogonalization that you wrote in part 3. The output of the program
should include the parameter estimates, the standard errors of the
parameters,
the estimated value
of and the residual value
for each observation.
Hints: Let be and be . If you use the
augmented matrix instead of just , and orthogonalize
only the first p columns, then the last column of the orthogonalized
matrix will be the residuals. To get the standard errors of the
parameter estimates, you may need to invert an upper triangular
matrix. You can use the following algorithm. Let T be a
upper triangular matrix, and let U be it's inverse.
for to by
for to by
end
end