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)

Arguments

method

The lcMethod object.

envir

The environment in which the lcMethod should be evaluated

...

Not used.

Value

The evaluated and finalized lcMethod object.

Implementation

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)
})

Estimation procedure

The steps for estimating a lcMethod object are defined and executed as follows:

  1. compose(): Evaluate and finalize the method argument values.

  2. validate(): Check the validity of the method argument values in relation to the dataset.

  3. prepareData(): Process the training data for fitting.

  4. preFit(): Prepare environment for estimation, independent of training data.

  5. fit(): Estimate the specified method on the training data, outputting an object inheriting from lcModel.

  6. postFit(): Post-process the outputted lcModel object.

The result of the fitting procedure is an lcModel object that inherits from the lcModel class.