Personal tools
You are here: Home teaching psych254 estimate_ols.m
Log in


Forgot your password?
 

estimate_ols.m

function [b_est, v_est] = estimate_ols(y,X) % estimate glm using OLS b_est = pinv(X)*y; residuals=y - X*b_est; %v_est=sqrt(residuals'*residuals); % THIS IS WRONG - FIX IT v_est=(y'*y - b_est'*X'*X*b_est)/(size(X,1)-size(X,2));
Document Actions