Displaying 2 results from an estimated 2 matches for "xtxi".
Did you mean:
ctxi
2002 Jun 19
2
solve() doesn`t work
...hope somebody can help
me. This is what I did.
> kurse <- read.table("kurse.txt", header=T, dec=",")
> x <- cbind(1,kurse[,-c(1)])
> y <- kurse$index
> t(x) %*% x
Error in t(x) %*% x : requires numeric matrix/vector arguments
> x <- as.matrix(x)
> xtxi <- solve(t(x) %*% x)
Error in solve.default(t(x) %*% x) : singular matrix `a' in solve
My data looks like this:
index bmw mru rwe vow kar sie bas
1 159.70 74.18 338.21 89.03 110.30 141.23 178.53 67.97
2 160.76 73.46 343.66 89.38 110.30 142.66 180.45 68.30
3 162.45...
2006 Feb 08
0
bayesm, rmnlIndepMetrop
...observations,
dim(X) [1] 276 5, nu=6. So I run such code:
if(nchar(Sys.getenv("LONG_TEST")) != 0) {R=2000} else {R=10}
set.seed(66)
df=read.table("X_metrop.dat",header=TRUE)
inp=as.matrix(df)
y=as.numeric(inp[,1])
n=length(y)
p=4
nvar=ncol(X)
X=cbind(1,inp[,2:5])
XTXI=chol2inv(chol(crossprod(X)))
bhat=XTXI%*%t(X)%*%y
#create X matrix with dim nobs*p x nvar
index=1:n
index2=rep(index,p)
index3=sort(index2)
X=X[index3,]
beta=array(bhat,dim=c(nvar))
A=diag(c(rep(.01,length(beta))));
betabar=rep(0,length(beta))
Data=list(y=y,X=X,p=p);
Mcmc=list(R=R,keep=1...