View source: R/update.starting.parameters.R
update.starting.parameters | R Documentation |
Internal scampr function that gets warm starting parameters to pass to TMB
## S3 method for class 'starting.parameters'
update(
new.start.pars,
old.start.pars,
target.approx.type = c("laplace", "variational", "not_sre")
)
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'. |
a data.frame (sparse or dense depending on parameter bf.matrix.type)
# 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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.