get_results {genscore} | R Documentation |
Estimate \mathbf{K}
and \boldsymbol{\eta}
using elts from get_elts()
given one \lambda_{\mathbf{K}}
(and \lambda_{\boldsymbol{\eta}}
if non-profiled non-centered) and applying warm-start with strong screening rules.
Description
Estimate \mathbf{K}
and \boldsymbol{\eta}
using elts from get_elts()
given one \lambda_{\mathbf{K}}
(and \lambda_{\boldsymbol{\eta}}
if non-profiled non-centered) and applying warm-start with strong screening rules.
Usage
get_results(
elts,
symmetric,
lambda1,
lambda2 = 0,
tol = 1e-06,
maxit = 10000,
previous_res = NULL,
is_refit = FALSE
)
Arguments
elts |
A list, elements necessary for calculations returned by |
symmetric |
A string. If equals |
lambda1 |
A number, the penalty parameter for |
lambda2 |
A number, the penalty parameter for |
tol |
Optional. A number, the tolerance parameter. |
maxit |
Optional. A positive integer, the maximum number of iterations. |
previous_res |
Optional. A list or |
is_refit |
A boolean, in the refit mode for BIC estimation if |
Details
If elts$domain_type == "simplex"
, symmetric != "symmetric"
or elts$centered == FALSE && elts$profiled_if_noncenter
are currently not supported.
If elts$domain_type == "simplex"
and elts$setting
contains substring "sum0"
, it is assumed that the column and row sums of K
are all 0 and estimation will be done by profiling out the diagonal entries.
Value
converged |
A boolean indicating convergence. |
crit |
A number, the final penalized loss. |
edges |
A vector of the indices of entries in the |
eta |
A p-vector, the |
eta_support |
A vector of the indices of entries in the |
iters |
An integer, number of iterations run. |
K |
A p*p matrix, the |
n |
An integer, the number of samples. |
p |
An integer, the dimension. |
is_refit , lambda1 , maxit , previous_lambda1 , symmetric , tol |
Same as in the input. |
lambda2 |
Same as in the input, and returned only if |
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{get_results()}) 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, scale="norm", diag=dm)
test_nc_np <- get_results(elts_gauss_np, symmetric="symmetric", lambda1=0.35,
lambda2=2, previous_res=NULL, is_refit=FALSE)
test_nc_np2 <- get_results(elts_gauss_np, symmetric="and", lambda1=0.25,
lambda2=2, previous_res=test_nc_np, is_refit=FALSE)
elts_gauss_p <- get_elts(h_hp, x, setting="gaussian", domain=domain,
centered=FALSE, profiled=TRUE, scale="norm", diag=dm)
test_nc_p <- get_results(elts_gauss_p, symmetric="symmetric",
lambda1=0.35, lambda2=NULL, previous_res=NULL, is_refit=FALSE)
elts_gauss_c <- get_elts(h_hp, x, setting="gaussian", domain=domain,
centered=TRUE, scale="norm", diag=dm)
test_c <- get_results(elts_gauss_c, symmetric="or", lambda1=0.35,
lambda2=NULL, previous_res=NULL, is_refit=FALSE)