calculate {mspath}R Documentation

calculate

Description

Tell a calculator to perform its main calculation.

Usage

calculate(calc, params, activeCases, do.what)

Arguments

calc The calculator object, mspathCalculator or an extension.
params Optional "numeric" vector of the free parameters of the calculator. If missing, use the values already in the calculator.
activeCases Optional "numeric" vector of ID's of cases over which the calculation will be performed. Note these will be converted to integer before use, and they are case ID's, not indices into the data. activeCases should be a subset of the cases in the calculator; ID's that are not will be ignored. As a special case, integer() for this argument means “use all cases.” If missing, use the values already in the calculator.
do.what Optional integer giving the code for the type of computation to perform. If missing, use the value already in the calculator.

Details

Performs the necessary calculation by invoking C++. The calculation may be time-consuming, which is why the computation must be invoked by this method rather than happening automatically.

Value

Returns the calc argument, updated with the return value and any state changes, including those from the optional arguments. You must use the returned value, not the one passed in as an argument, after the call.
results and minus2loglik, among other methods, will extract the results. The exact results depend upon the mode (do.what) of the calculation; sometimes only counts of paths and related parameters are returned.

Methods

calc = "mspathCalculator", params = "ANY", activeCases = "ANY", do.what = "ANY"
Perform the multi-state path model calculation.
calc = "mspathDistributedCalculator", params = "numeric", activeCases = "missing", do.what = "missing"
Distribute the multi-state calculation across processors. That calculation will be for all cases, and always computes the likelihood; thus the 2 related arguments must be omitted. Different subsets of cases are distributed to different processors.

Note

These methods are mostly for internal use. You must always and exclusively use the return value, not the original calc, after calling this function. As an incentive, this is the only way to get the results. Results are not in a separate object, because returning a separate results object would make it awkward to return an updated calculator.

Author(s)

Ross Boylan

See Also

mspathCalculator, mspathDistributedCalculator


[Package mspath version 0.9-9 Index]