Description Usage Arguments Details Value Author(s) See Also Examples
View source: R/post.shrinkage.R
post.shrinkage.mean
computes the mean fitted estimates as a function of the mean regression coefficient estimates over all regressions.
1 | post.shrinkage.mean(out, X, vreg, plot=T)
|
out |
output of MCMC simulation |
X |
regression matrix used in the simulation |
vreg |
number of the regression coefficient |
plot |
{T,F} output plot (default=T) |
To assess the influence of the hyperparameter nu on the dispersion of the fitted estimates and regression coefficient estimates two plots are available in the package: one in terms of means values, the other in terms of maximum and minimum values. These plots help visualizing shrinkage by analyzing the influence of the hyperparameter nu on the estimates. Different shrinkage plots may be compared for simulations with different nu values.
a list containing
yrecmean |
mean of fitted values |
beta |
mean of estimated coefficients over all regressions |
A. Ferreira da Silva, Universidade Nova de Lisboa,
Faculdade de Ciencias e Tecnologia,
afs@fct.unl.pt.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | ## Not run:
slicedata <- read.fmrislice(fbase="fmri", slice=3, swap=FALSE)
ymaskdata <- premask(slicedata)
fsave <- paste(tempdir(),"/simultest1",fileext = ".sav", sep="")
nu1 <- 3
out1 <- cudaMultireg.slice(slicedata, ymaskdata, R=2000, keep=5, nu.e=nu1,
fsave=fsave1, zprior=FALSE, rng=1 )
fsave <- paste(tempdir(),"/simultest2",fileext = ".sav", sep="")
nu2 <- slicedata$nobs
out2 <- cudaMultireg.slice(slicedata, ymaskdata, R=2000, keep=5, nu.e=nu2,
fsave=fsave2, zprior=FALSE, rng=1 )
vreg <- 2
x1 <- post.shrinkage.mean(out1, slicedata$X, vreg=vreg, plot=F)
x2 <- post.shrinkage.mean(out2, slicedata$X, vreg=vreg, plot=F)
par(mfrow=c(1,2), mar=c(4,4,1,1)+0.1)
xlim=range(c(x1$beta, x2$beta))
ylim=range(c(x1$yrecmean, x2$yrecmean))
plot(x1$beta, x1$yrecmean,type="p", pch="+", col="violet", ylim=ylim,
xlim=xlim, xlab=expression(beta), ylab="y")
legend("topright", expression(paste(nu,"=3")), bg="seashell")
plot(x2$beta, x2$yrecmean,type="p", pch="+", col="blue", ylim=ylim,
xlim=xlim, xlab=expression(beta), ylab="y")
legend("topright", expression(paste(nu,"=45")), bg="seashell")
par(mfrow=c(1,1))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.