greg: Regularized graphical model estimation

Description Usage Arguments Value See Also Examples

View source: R/greg.R

Description

greg calculate the regularized graphical model estimation using lasso, scad and adaptive lasso penalties. It report the results in the form of roc results for each method.

Usage

1
greg(z, A, eps = 1e-15, rholist = NULL, gamma = 0.5, trace = FALSE)

Arguments

z

n * p dimensional matrix

A

p * p true graph

eps

a tolerence level for thresholding

rholist

a sequence of penalty parameters

gamma

the adaptive lasso penalty parameter

trace

whether to trace to estimation process.

Value

a list.

roc.lasso

roc results for lasso

roc.scad

roc results for scad

roc.alasso

roc results for adaptive lasso

See Also

pgraph, roc, projcov

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
set.seed(0)
p = 20;
n = 300;
tmp=runif(p-1,1,3)
s=c(0,cumsum(tmp));
s1=matrix(s,p,p)
cov.mat.true=exp(-abs(s1-t(s1)))
prec.mat.true=solve(cov.mat.true);
a=matrix(rnorm(p*n),n,p)
data.sa=a%*%chol(cov.mat.true);
true.graph = outer(1:p,1:p,f<-function(x,y){(abs(x-y)==1)})
greg.fit = greg(data.sa, true.graph)
auc.lasso = sum(diff(greg.fit$roc.lasso[,1])*greg.fit$roc.lasso[-1,2])
auc.alasso = sum(diff(greg.fit$roc.alasso[,1])*greg.fit$roc.alasso[-1,2])
auc.scad = sum(diff(greg.fit$roc.scad[,1])*greg.fit$roc.scad[-1,2])
auc.lasso
auc.alasso
auc.scad

Example output

[1] 0.8479532
[1] 0.8464143
[1] 0.8790397

pgraph documentation built on Jan. 21, 2020, 5:07 p.m.

Related to greg in pgraph...