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


Forgot your password?
 

run_glm.m

% run_glm.m % create data using forward model X=zeros(1000,2); v=10; % variance of normal dist beta = [5 2.5]'; counter=1; for A=[1:10], for B=[10:10:100], for rep=1:10 X(counter,1)=A; X(counter,2)=B; counter=counter+1; end; end; end; b_est=zeros(2,1000); for run=1:1000, simulated_data=create_glm_dataset(X,beta,v); b_est(:,run)=estimate_ols(simulated_data,X); if mod(run,100)==0, fprintf('run %d...\n',run); end; end; subplot(1,2,1) hist(b_est(1,:),50); subplot(1,2,2) hist(b_est(2,:),50);
Document Actions