Displaying 1 result from an estimated 1 matches for "truep".
Did you mean:
true
2010 Jul 30
1
hi! l have a question please help me
1)
dmatrix1<-function(n,p,rho,sigma,k){
muvec1=zeros(1,p)
truep<-as.matrix(c(3,1.5,0,0,2,0,0,0))
A=eye(p)
for(i in 1:p){
for(j in 1:p){
A[i,j]=rho^(abs(i-j))
X=mvrnorm(n,muvec1,A)
y=X%*%truep+as.matrix(rnorm(n,0,sigma))
Y=X[1:k,]
w=y[1:k]
Z=X[(k+1):n,]
z=y[(k+1):n]}}
return(list(X,Y,w,Z,z))
}...