[R] penalized quantile regression (rq.fit.lasso)

2012-05-05 Thread Yuanyuan Tang
Dear all: I have a question about how to get the optimal estimate of coefficients using the penalized quantile regression (LASSO penalty in quantile regression defined in Koenker 2005). In R, I found both rq(y ~ x, method=lasso,lambda = 30) and rq.fit.lasso(x, y, tau = 0.5, lambda = 1, beta =

[R] rwmetrop

2012-04-08 Thread Yuanyuan Tang
Hi, all: Can anybody check where is wrong with my code? I tried a lot of times, but did not find an error. The parameters' estimator is not accurate. It's a simple model about a multiple regression, with five covariates. rwmetrop is supposed to give a much more accurate estimand. Thanks a lot.

[R] cv.glmnet

2012-03-20 Thread Yuanyuan Tang
Hi, all: Does anybody know how to avoid the intercept term in cv.glmnet coefficient? When I say avoid, it does not mean using coef()[-1] to omit the printout of intercept, it means no intercept at all when doing the analysis. Thanks. [[alternative HTML version deleted]]

[R] Jags problem

2012-01-23 Thread Yuanyuan Tang
Hi, all: I met Non-conforming parameters for function %*% problem, when I run the Jags model in R. My model is like this: model{ for(i in 1:n){ for(j in 1:t[i]){ et[i,j]-yt[i,j]-beta0+betax*xt[i,j]+betat*t[i,j] } for(a in 1:t[i]){ for(b in 1:t[i]){

[R] Cannot evaluate subset expression for sigmainverse

2012-01-23 Thread Yuanyuan Tang
Hi, anybody can help me with this? can JAGS solve the inverse of a matrix in the 3-way array? Thank you! for(i in 1:n){ for(a in 1:t[i]){ for(b in 1:t[i]){ sigma[i,a,b]-pow(rho,t[a]-t[b]) } } sigmainverse[i,,]-inverse(sigma[i,,]) # this is where jags got error }