Note: this function should not be called directly, as it is part of the lcMethod
estimation procedure.
For fitting an lcMethod
object to a dataset, use the latrend()
function or one of the other standard estimation functions.
The compose()
function of the lcMethod
object evaluates and finalizes the lcMethod
arguments.
The default implementation returns an updated object with all arguments having been evaluated.
compose(method, envir, ...)
# S4 method for class 'lcMethod'
compose(method, envir = NULL)
The evaluated and finalized lcMethod
object.
In general, there is no need to extend this method for a specific method, as all arguments are automatically evaluated by the compose,lcMethod
method.
However, in case there is a need to extend processing or to prevent evaluation of specific arguments (e.g., for handling errors), the method can be overridden for the specific lcMethod
subclass.
setMethod("compose", "lcMethodExample", function(method, envir = NULL) {
newMethod <- callNextMethod()
# further processing
return(newMethod)
})
The steps for estimating a lcMethod
object are defined and executed as follows:
compose()
: Evaluate and finalize the method argument values.
validate()
: Check the validity of the method argument values in relation to the dataset.
prepareData()
: Process the training data for fitting.
preFit()
: Prepare environment for estimation, independent of training data.
fit()
: Estimate the specified method on the training data, outputting an object inheriting from lcModel
.
postFit()
: Post-process the outputted lcModel
object.
The result of the fitting procedure is an lcModel object that inherits from the lcModel
class.