Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Topic: undefined independent variable x
Replies: 2   Last Post: May 20, 2013 11:09 AM

 Messages: [ Previous | Next ]
 Kam Hoi Posts: 1 Registered: 5/20/13
undefined independent variable x
Posted: May 20, 2013 9:13 AM

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

Date Subject Author
5/20/13 Kam Hoi
5/20/13 Steven Lord
5/20/13 Curious