test_lambda_bounds | R Documentation |
\lambda_{\boldsymbol{K}}
that gives the empty or complete graph starting from a given lambda with a given step sizeSearches 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, each time updating by multiplying or dividing by step
depending on the search direction.
test_lambda_bounds(
elts,
symmetric,
lambda = 1,
lambda_ratio = 1,
step = 2,
lower = TRUE,
verbose = TRUE,
tol = 1e-06,
maxit = 10000,
cur_res = NULL
)
elts |
A list, elements necessary for calculations returned by |
symmetric |
A string. If equals |
lambda |
A number, the initial searching point for |
lambda_ratio |
A positive number (or |
step |
A number, the multiplicative constant applied to lambda at each iteration. Must be strictly larger than 1. |
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. |
cur_res |
Optional. A list, current results returned from a previous lambda. If provided, used as a warm start. Default to |
lambda |
A number, the best |
cur_res |
A list, results for this |
# 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_bounds()}) 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)
lambda_cur_res <- test_lambda_bounds(elts_gauss_np, "symmetric", lambda=1,
lambda_ratio=1, step=1.5, lower=TRUE, cur_res=NULL)
lambda_cur_res2 <- test_lambda_bounds(elts_gauss_np, "symmetric", lambda=1,
lambda_ratio=1, step=1.5, lower=FALSE, cur_res=lambda_cur_res$cur_res)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.