Displaying 1 result from an estimated 1 matches for "z1hat".
Did you mean:
f1hat
2012 Jul 17
1
Threshold Quantile Regression code CRASHES in R
...kx),n,kx)
q <- matrix(rnorm(n),n,1)
z2 <- cbind(matrix(1,n,1),q)
for(i in 1:reps){
e <- matrix(rnorm(n*2,quantile(rnorm(n),tau),1),n,2)%*%chol(sig)
z1=0.5+0.5*x*(q<=0)+1*x*(q>0)+e[,2]
y=0.5+1*z1*(q<=1)+1.5*z1*(q>1)+1*z2[,2]+e[,1]
out1 <- joint_thresh(y=z1,x=x,q=q)
z1hat<- out1$yhat
rhohat[i] <- out1$qhat
zhat <- cbind(z1hat,z2)out2 <- joint_thresh_2(y=y,x=zhat,q=q)
qhat[i] <- out2$qhat
} #Close for loop.
list(rhohat=rhohat,qhat=qhat)
}
#************************************************************#You can easily run it yourselves. The problem i...