Description Usage Arguments Details Value Author(s) References See Also Examples

This function is to conduct model selection for time-varying graphical models based on cross validation results from loggle.cv.h.

1 2 | ```
loggle.cv.select.h(cv.result, select.type = "all_flexible",
cv.vote.thres = 0.8)
``` |

`cv.result` |
a list: results from loggle.cv.h |

`select.type` |
a string: "all_flexible" – optimal |

`cv.vote.thres` |
a scalar between 0 and 1: an edge is kept after cv.vote if and only if it exists in no less than |

`select.type = "all_flexible"`

is for the situation where we expect both the extent of structure smoothness (controlled by `d`

) and the extent of graph sparsity (controlled by `lambda`

) vary across time points. If only the extent of graph sparsity varies across time points, `select.type = "d_fixed"`

should be used. If both of them are expected to be similar across time points, `select.type = "all_fixed"`

should be used.

`cv.vote.thres`

controls the tradeoff between false discovery rate and power in model selection. A large value of `cv.vote.thres`

would decrease false discovery rate but also hurt power.

`d.opt` |
a vector of optimal values of |

`lambda.opt` |
a vector of optimal values of |

`cv.score.opt` |
optimal cv score (averaged over time points and cv folds) |

`edge.num.opt` |
a vector of numbers of edges for each estimated graph |

`edge.opt` |
a list of edges for each estimated graph |

`adj.mat.opt` |
a list of adjacency matrices for each estimated graph |

Yang, J. and Peng, J.

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

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.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ```
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 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)
# conduct model selection using cross-validation results
select.result <- loggle.cv.select.h(cv.result = result,
select.type = "all_flexible", cv.vote.thres = 0.8)
# optimal values of d and lambda, and number of
# selected edges at each time point
print(cbind("time" = seq(0.1, 0.9, length=9),
"d.opt" = select.result$d.opt,
"lambda.opt" = select.result$lambda.opt,
"edge.num.opt" = select.result$edge.num.opt))
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.