update.starting.parameters: Internal scampr function that gets warm starting parameters...

View source: R/update.starting.parameters.R

update.starting.parametersR Documentation

Internal scampr function that gets warm starting parameters to pass to TMB

Description

Internal scampr function that gets warm starting parameters to pass to TMB

Usage

## S3 method for class 'starting.parameters'
update(
  new.start.pars,
  old.start.pars,
  target.approx.type = c("laplace", "variational", "not_sre")
)

Arguments

new.start.pars

either a fitted model or named list of starting parameters

old.start.pars

a named list of starting parameters

target.approx.type

a character string, one of 'laplace', 'variational' or 'not_sre'.

Value

a data.frame (sparse or dense depending on parameter bf.matrix.type)

Examples

# Get the gorilla nesting data
data(gorillas, package = "scampr")
dat <- gorillas

# Standardise the elevation covariate
dat$elev.std <- scale(dat$elevation)

# Fit a scampr model to the point pattern
m <- scampr(pres ~ elev.std, data = dat, include.sre = F)

# Get new start parameters
update.startingp.parameters(m, list(fixed = rep(0, ncol(dat.list$X_PO_pres)),
  random = rep(0, ncol(dat.list$Z_PO_pres)),
  log_variance_component = var.starts))

ElliotDovers/scampr documentation built on March 17, 2024, 3:27 p.m.