update {causalSLSE} | R Documentation |
Update Methods
Description
The method updates an object by modifying its specification. Currently, it is used to change the set of knots by either selecting them manually or by specifying the selection methods.
Usage
## S3 method for class 'cslseModel'
update(object, selType, selCrit="AIC",
selKnots, ...)
## S3 method for class 'slseModel'
update(object, selType, selCrit="AIC",
selKnots, ...)
## S3 method for class 'slseKnots'
update(object, selKnots, ...)
Arguments
object |
An object to be modified. |
selKnots |
An optional list of integers to select the knots from the original list of knots. If missing, the current knots are kept. |
selType |
The selection method: |
selCrit |
The criterion to select the optimal set of knots. |
... |
Argument for other types of objects. Currently not used. |
Details
The method for slseKnots
is explained in the vignette, but it
is mostly used internally. For the model objects, the method can be used
to choose a set of knots already stored in the object. It avoids
having to re-compute them which can be computationally intensive for
large samples. It returns an error message if the type of selection
requested does not exist. In that case, you need to run the
selSLSE
method. If the selType
argument is set to
None
, the method returns the original model.
Value
It returns an object of the same class, but with a different set of knots.
See Also
selSLSE
for more details on how stored knots can
be selected from a model, slseModel
for model
description and slseKnots
for the format of knots
Examples
data(simDat3)
mod1 <- cslseModel(Y ~ Z | ~ X1 * X2, data = simDat3)
mod2 <- selSLSE(mod1, "BLSE", "AIC")
## We changed the knots to the BLSE-BIC selection
## already stored in the model object
update(mod2, "BLSE", "BIC")
## We recover the original set of knots
update(mod2, "None")