Date: May 20, 2013 11:09 AM
Author: Curious
Subject: Re: undefined independent variable x

"Kam Hoi" wrote in message <knd7h7$cq3$1@newscl01ah.mathworks.com>...
> When i type the followings
> function [b, CI, R, Yhat_CI, e]=OSL_robust (X, Y, significance)
> b=inv(X'*X)*(X'*Y)
> cov=inv(X'*X)*(X'*diag(e^2)*X)*inv(X'*X)
> se=(diag(cov))^0.5
> t=b./se
> p=2*(1-cdf('norm',abs(t),0,1))
> R2c=1-(((e'*e)/T)/var(Y,1))
> R2u=1-((e'*e)/Y'*Y)
> AR2c=1-((1/T-K-1)*e'*e)*(var(Y))
> AR2u=1-((1/T-K)*e'*e)/((Y'*Y)/T)
> CIU=(b+1.96*se)
> CIL=(b+1.96*se)
> Yhat=Xb
> Yhat_CI=[X*CIU,X*CIL]
> e=Y-Yhat
>
>
> It comes out that
> ??? Input argument "X" is undefined.
>
> Error in ==> OSL_robust at 2
> b=inv(X'*X)*(X'*Y)
>
> i am instructed to know that x independent variable X is (T by (K=1))
> I am a beginner of matlab, hope anyone can help me~~ Thx


How do you call OSL_robust?

Do you do somethiong like:

[b, CI, R, Yhat_CI, e]=OSL_robust (X, Y, significance)