loggle (version 1.0)

loggle.refit: A function to conduct model refitting given learned graph structures

Description

This function is to efficiently conduct model refitting given learned time-varying graph structures. Time-varying graph structures can be learned from loggle, loggle.cv.vote, loggle.cv or loggle.cv.h.

Usage

loggle.refit(X, pos, adj.mat, h = 0.8*ncol(X)^(-1/5), 
print.detail = TRUE)

Arguments

X

a p by N data matrix containing observations on a time grid ranging from 0 to 1: p -- number of variables, N -- number of time points. The nominal time for the kth time point is (k-1)/(N-1)

pos

a vector constitutes a subset of {1, 2, ..., N}: indices of time points where graphs are estimated, default = 1:N

adj.mat

a list of the same length as pos: adjacency matrices at time points specified by pos

h

a scalar between 0 and 1: bandwidth in kernel smoothed sample covariance/correlation matrix, default = 0.8*N^(-1/5)

print.detail

logic: if TRUE, print details in model refitting procedure, default = TRUE

Value

Omega

a list of estimated precision matrices at time points specified by pos

Details

Function "glasso" in R package glasso is applied in model refitting.

References

Yang, J. & Peng, J. (2018), 'Estimating Time-Varying Graphical Models', arXiv preprint arXiv:1804.03811

See Also

loggle for learning time-varying graphical models, loggle.cv for learning time-varying graphical models via cross validation, loggle.cv.select for model selection based on cross validation results.

Examples

Run this code
# NOT RUN {
data(example)  # load example dataset
X <- example$X  # data matrix
dim(X)  # dimension of data matrix

# positions of time points to estimate graphs
pos <- round(seq(0.1, 0.9, length=9)*(ncol(X)-1)+1)
# estimate time-varying graphs and conduct model 
# selection via cross-validation
result <- loggle.cv.h(X, pos, h = 0.2, 
d.list = c(0, 0.05, 0.15, 1), lambda.list 
= c(0.2, 0.25), cv.fold = 3, fit.type = "pseudo", 
cv.vote.thres = 1, num.thread = 1)

# estimated adjacency matrices at each time point
adj.mat.opt <- result$cv.select.result$adj.mat.opt
# estimated precision matrices at each time point
# via model refitting
Omega.opt <- loggle.refit(X, pos, adj.mat.opt)
# }

Run the code above in your browser using DataLab