test_lambda_bounds2 {genscore} | R Documentation |
Searches for a tight bound for \lambda_{\boldsymbol{K}}
that gives the empty or complete graph starting from a given lambda
Description
Searches for the smallest lambda that gives the empty graph (if lower == FALSE
) or the largest that gives the complete graph (if lower == TRUE
) starting from the given lambda.
Usage
test_lambda_bounds2(
elts,
symmetric,
lambda_ratio = Inf,
lower = TRUE,
verbose = TRUE,
tol = 1e-06,
maxit = 10000,
lambda_start = NULL
)
Arguments
elts |
A list, elements necessary for calculations returned by get_elts(). |
symmetric |
A string. If equals |
lambda_ratio |
A positive number (or |
lower |
A boolean. If |
verbose |
Optional. A boolean. If |
tol |
Optional. A number, the tolerance parameter. |
maxit |
Optional. A positive integer, the maximum number of iterations in model fitting for each lambda. |
lambda_start |
Optional. A number, the starting point for searching. If |
Details
This function calls test_lambda_bounds
three times with step
set to 10
, 10^(1/4)
, 10^(1/16)
, respectively.
Value
A number, the best lambda that produces the desired number of edges. 1e-10
or 1e15
is returned if out of bound.
Examples
# Examples are shown for Gaussian truncated to R+^p only. For other distributions
# on other types of domains, please refer to \code{gen()} or \code{get_elts()}, as the
# way to call this function (\code{test_lambda_bounds2()}) is exactly the same in those cases.
n <- 50
p <- 30
domain <- make_domain("R+", p=p)
mu <- rep(0, p)
K <- diag(p)
x <- tmvtnorm::rtmvnorm(n, mean = mu, sigma = solve(K),
lower = rep(0, p), upper = rep(Inf, p), algorithm = "gibbs",
burn.in.samples = 100, thinning = 10)
h_hp <- get_h_hp("min_pow", 1, 3)
dm <- 1 + (1-1/(1+4*exp(1)*max(6*log(p)/n, sqrt(6*log(p)/n))))
elts_gauss_np <- get_elts(h_hp, x, setting="gaussian", domain=domain,
centered=FALSE, profiled=FALSE, diag=dm)
test_lambda_bounds2(elts_gauss_np, "symmetric", lambda_ratio=2,
lower=TRUE, verbose=TRUE, lambda_start=NULL)
test_lambda_bounds2(elts_gauss_np, "symmetric", lambda_ratio=2,
lower=FALSE, verbose=TRUE, lambda_start=1.0)