Compare: Compare with the existing function blasso in R package...

Description Examples

Description

We compare the MSE which generates from the function we write with the function blasso in monomvn

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
## Not run: 
library(monomvn)
data(Data)
attach(Data)
x<-Data$diabetes.x
y<-Data$diabetes.y
n<-nrow(Data$diabetes.x)
yc<-y-mean(y)
result<-BayesianLasso(x,y)
proc.time()
resid<-yc-x%*%result$beta
mse1<-t(resid)%*%resid/n
n.max=1e4
result1<-blasso(x,y,T=n.max)
proc.time()
result2<-round(apply(result1$beta[seq(round(n.max/2),n.max),],2, median),3)
resid<-yc-x%*%result2
mse2<-t(resid)%*%resid/n
mse1;mse2

## End(Not run)

USTCLifengLiu/StatComp21038 documentation built on Dec. 23, 2021, 10:18 p.m.