knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(mvtnorm)
library(glasso)
library(Matrix)
require(linprog)
library(R.matlab)
library(igraph)

library(Difdtl)
library(lassoshooting)
source('../R/deGEM.R')

Introduction

In this vignette, we illustrate the use of deGEM for joint estimation of multiple differential networks.

The function deGEM depends on the lasso shooting algorithm from the R package lassoshooting, which solves the following lasso problem: [ 0.5 \beta' \Sigma \beta - \beta' \delta + \lambda\|\beta\|_1. ] Note the above problem is very similar to the usual lasso problem for linear models $Y = X\beta + \epsilon$. In fact, one can think of $\Sigma$ as $X'X$ and $\delta$ as $X'Y$. To install this package, run the following

install.packages("lassoshooting")

The function deGEM also depends on the R package Difdtl for differential network analysis with D-trace loss. To install this package, run the following

install.packages("http://www.math.pku.edu.cn/teachers/xirb/downloads/software/DtraceLoss/Difdtl_1.0.tar.gz", repos = NULL, type='source')

Simulation Example

In this example, we simulate a Gaussian mixture model with 3 components, with balanced mixing proportion. We first load data.

# load('../../../2_Results/R_gnp/data_20180208_p50_N300_s10_beta10_gnp.rda')
lambda = c(0.1, 0.1, 0.1)
K = 3
z = Y_train[sample_label_train==1,]

out = deGEM(z,K,lambda)

Figures

The figure sizes have been customised so that you can easily put two images side-by-side.

plot(1:10)
plot(10:1)


drjingma/deGEM documentation built on May 25, 2019, 4:24 p.m.