Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

get_inits_from_fit

Initiate a fit from another fit


Description

get_inits_from_fit is an extractor of some fitted values from a fit in a convenient format to initiate a next fit.

Usage

get_inits_from_fit(from, template = NULL, to_fn = NULL, inner_lambdas=FALSE)

Arguments

from

Fit object (inheriting from class "HLfit") from which fitted values are taken.

template

Another fit object. Usage with a template fit object is suitable for refitting this object using fitted values from the from object as starting values.

to_fn

NULL or character: the name of the function to be used the next fit. If NULL, taken from template (if available), else from from. It is meaningful to provide a to_fn distinct from the function used to fit a template.

inner_lambdas

Boolean; Whether the output should include estimates of the dispersion parameters estimated by the iterative methods implemented in HLfit.

Value

A list with elements

init, init.corrHLfit

(depending on the fitting function) giving initial values for outer-optimization;

init.HLfit

giving initial values for the iterative algorithms in HLfit. It is itself a list with possible elements:

fixef

for the coefficients of the linear predictor, adjusted to the format of the coefficients of the linear predictor of the template object, if available;

ranCoefs

random-coefficients parameters (if not outer-optimized).

See Also

Examples

## Not run: 
data("blackcap")
(corrhlfit <- corrHLfit(migStatus ~ means+ Matern(1|longitude+latitude),data=blackcap,
                        method="ML")) 
inits <- get_inits_from_fit(corrhlfit, to_fn = "fitme")                    
(fitfit <- fitme(migStatus ~ means+ Matern(1|longitude+latitude),data=blackcap, 
                  init=inits$init)) 
inits <- get_inits_from_fit(corrhlfit, template = fitfit)                    
fitme(migStatus ~ means+ Matern(1|longitude+latitude),data=blackcap, 
      init=inits$init)
# In these examples, inits$init.HLfit is useless 
# as it is ignored when LMMs are fitted by fitme().

## End(Not run)

spaMM

Mixed-Effect Models, with or without Spatial Random Effects

v3.10.0
CeCILL-2
Authors
François Rousset [aut, cre, cph] (<https://orcid.org/0000-0003-4670-0371>), Jean-Baptiste Ferdy [aut, cph], Alexandre Courtiol [aut] (<https://orcid.org/0000-0003-0637-2959>), GSL authors [ctb] (src/gsl_bessel.*)
Initial release
2022-02-06

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.