Professional Documents
Culture Documents
hw4p5 PDF
hw4p5 PDF
m_z =
0.0007
0.0009
-0.0016
0.0002
0.0016
-0.0013
-0.0012
-0.0019
0.0004
-0.0001
sigma_z_sq =
0.0101
g =
-0.9996
-0.0058
0.0035
-0.0008
0.0183
0.0127
0.0050
0.0028
-0.0166
0.0018
sigma_w_sq =
0.0349
h =
0.7075
0.7066
-0.0017
-0.0016
0.0015
0.0004
-0.0055
0.0011
0.0025
-0.0068
correct =
2274
% Homework 4, problem 5.
load('hw4-data/data.mat');
% N is dimension of data
N = size(Y_z, 1);
% M is number of samples
M = size(Y_z, 2);
m_z = sum(Y_z, 2) / M;
fprintf('Mean of Z:\n');
m_z
K_z = zeros(N,N);
for i=1:M
K_z = K_z + Y_z(:,i)*Y_z(:,i)';
end
%fprintf('K_z estimate:\n');
K_z = K_z / M;
% Estimate of sigma_z^2 is mean of trace).
sigma_z_sq = trace(K_z) / N