%function rho = ML_norm(unnorm_controls) % takes as input the unnormalized control data % returns the normalization constants (as log values) function rho = ML_norm(unnorm_controls) [M,N] = size(unnorm_controls); %#rows = #controls, #col = #expt %set the initial parameters: newrho = zeros(1,N); %matrix containing zeros, our initial estimate of norm constants rho = ones(1,N); %matrix containing ones, to ensure our loop runs the first time while max(abs(rho-newrho))>0.000001 %calculates rho to a precision of 0.000001 rho = newrho; %sets the old value = new value %YOUR CODE HERE. You need to calculate the values of the parameters mu, %sigma2 and newrho. Remember the Matlab function to replicate a matrix: % repmat(matrix, num_rows, num_columns) %It is very helpful in completing this function. end rho = newrho; %best estimate of normalization constants return