Learn R Programming

lame (version 1.3.4)

update.ame: Update an AME / LAME fit

Description

S3 method for update that re-fits the model with modified arguments. Reuses the original call recorded in fit$call. If the fit was produced with freeze_call = TRUE, the data snapshot on fit$data_snapshot is used in place of looking up names in the caller's environment.

Usage

# S3 method for ame
update(object, ..., evaluate = TRUE)

# S3 method for lame update(object, ..., evaluate = TRUE)

Value

A new fitted object, or (when evaluate = FALSE) the modified call.

Arguments

object

A fitted ame or lame object.

...

Named arguments to overwrite in the original call (e.g. nscan = 5000, dynamic_beta = TRUE, R = 2).

evaluate

Logical: if TRUE (default), evaluate the updated call and return the new fit; if FALSE, return the unevaluated call.

Examples

Run this code
# \donttest{
data(YX_bin_list)
fit <- lame(YX_bin_list$Y, YX_bin_list$X, family = "binary",
            burn = 5, nscan = 20, odens = 1, verbose = FALSE)
# toggle dynamic_beta on without rewriting the whole call
fit_dyn <- update(fit, dynamic_beta = "dyad")
dim(fit_dyn$BETA)  # 3-D now
# }

Run the code above in your browser using DataLab