scalefreeForest: Scale-free forest density estimation

Description Usage Arguments Details Value Examples

Description

The main function for scale-free forest density estimation.

Usage

1
scalefreeForest(xtrain, xheld, lambda = seq(0.005, 0.15, 0.005), iter.max = 100, range = NULL, verbose = TRUE)

Arguments

xtrain

An n by d data matrix as training set, where n is the sample size and d is the dimension.

xheld

An m by d data matrix as held-out set, where m is the sample size and d is the dimension.

lambda

A sequence of positive numbers to control the regularization of the log degree penalty. The default value is seq(0.005, 0.15, 0.005).

iter.max

The maximal number of steps in the iterative reweighted Kruskal's algorithm. The default value is 100.

range

The range for each of the variables. The default value is NULL.

verbose

If verbose = FALSE, tracing information printing is disabled. The default value is TRUE.

Details

The training data set is used to construct scale-free forests and the corresponding density estimators, while the held-out data set is then used to determine the optimal scale-free forest by maximizing the held-out log-likelihood.

Value

loglike

Maximal held-out log-likelihood for the optimal scale-free forest density estimators corresponding to the regularization parameters.

adj

Adjacency matrices of the optimal scale-free forests corresponding to the regularization parameters.

best.loglike

Maximal held-out log-likelihood over all the regularization parameters.

best.adj

Adjacency matrix of the optimal scale-free forest corresponding to the maximum of the held-out log-likelihood over all the regularization parameters.

Examples

1
2
3
4
5
library(igraph)

fit <- scalefreeForest(xtrain, xheld)
sf <- fit$best.adj
plot(sf)

zhejosephliu/scalefreeForest documentation built on May 4, 2019, 10:17 p.m.