Operations on lists of parameters
get_ranPars
returns various subsets of random-effect parameters (correlation or variance parameters), as controlled by its which
argument.
It is one of several extractors for fixed or estimated parameters of different classes of parameters, for which a quick guide is
get_ranPars
: for random-effect parameters, excluding residual dispersion;VarCorr
: alternative extractor for random-effect (co)variance and optionally residual variance, in a data frame format;residVar
: for residual variance parameters, family dispersion parameters, or information about residual variance models;get_residVar
: alternative extractor of residual variances with different features inherited from get_predVar
;get_inits_from_fit
: extracts estimated parameters from a fit.
remove_from_parlist
removes elements from a list of parameters, and from its type
attribute.
get_ranPars(object, which=NULL, ...) remove_from_parlist(parlist, removand=NULL, rm_names=names(unlist(removand)))
object |
An object of class |
which |
NULL or character string. Use |
... |
Other arguments that may be needed by some method. |
parlist |
A list of parameters. see Details. |
removand |
Optional. A list of parameters to be removed from |
rm_names |
Names of parameters to be removed from |
For heteroscedastic models, such as conditional autoregressive models, the variance parameter “lambda” refers to a common scaling coefficient. For other random-effect models, “lambda” typically refers to the single variance parameter.
remove_from_parlist
is designed to manipulate structured lists of parameters, such as a list with elements phi
, lambda
, and corrPars
, the latter being itself a list structured as the return value of get_ranPars(.,which="corrPars")
. parlist
may have an attribute type
, also with elements phi
, lambda
, and corrPars
... If given, removand
must have the same structure (but typically not all the elements of parlist
); otherwise, rm_names
must have elements which match names of unlist(names(parlist))
.
get_ranPars(.,which="corrPars")
returns a (possibly nested) list of correlation parameters (or NULL if there is no such parameter). Top-level elements correspond to the different random effects. The list has a "type"
attribute having the same nested-list structure and describing whether and how the parameters where fitted: "fix"
means they where fixed, not fitted; "var"
means they were fitted by HLfit
's specific algorithms; "outer"
means they were fitted by a generic optimization method.
get_ranPars(.,which="lambda")
returns a vector of variance values, one per random effect, including both “outer”- and “inner”-optimized ones.
get_ranPars(.,which="outer_lambda")
returns only “outer”-optimized variance parameters, ignoring those fitted by HLfit
's specific algorithms.
get_ranPars(. which="ranef_var")
(experimental) returns a list with elements
Var
same as get_ranPars(.,which="lambda")
lembda_est
A vector of variance values, one for each level of each random effect
outer
A vector or outer-optimized variance values, as returned by get_ranPars(.,which="outer_lambda")
Other elements, subject to change in later versions.
remove_from_parlist
returns a list of model parameters with given elements removed, and likewise for its (optional) type
attribute. See Details for context of application.
See VarCorr
, residVar
, get_residVar
, or get_inits_from_fit
as described in in the quick guide above.
data("wafers") m1 <- HLfit(y ~X1+X2+(1|batch), resid.model = ~ 1, data=wafers, method="ML") get_ranPars(m1,which="corrPars") # NULL since no correlated random effect parlist1 <- list(lambda=1,phi=2,corrPars=list("1"=list(rho=3,nu=4),"2"=list(rho=5))) parlist2 <- list(lambda=NA,corrPars=list("1"=list(rho=NA))) # values of elements do not matter remove_from_parlist(parlist1,parlist2) ## same result as: remove_from_parlist(parlist1,rm_names = names(unlist(parlist2)))
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.