Error term, no zero conditional mean

조회 수: 1 (최근 30일)
M Fernandes
M Fernandes 2017년 9월 29일
Dear Matlab, I am testing the properties of the least squares estimator b under the Gauss-Markov assumptions, and I would like to see what happens if for example the error term does not have a zero conditional mean or does not follow a normal distribution. Could anyone explain me how should I recode the part of the error term? I already tried "e=rand(n,1)" but in the graph that I obtain, beta_hat looks that still follows a normal distribution.
alpha=1; beta=1; n=100; m=1000; beta_hat=zeros(m,1); for i=1:m x=randn(n,1); e=randn(n,1); y=alpha+beta*x+e; X=[ones(n,1) x]; beta_hatvec=(inv(X'*X))*X'*y; beta_hat(i)=beta_hatvec(2); end histfit(beta_hat)

답변 (0개)

카테고리

Help CenterFile Exchange에서 Random Number Generation에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by