calculate {mspath} | R Documentation |
Tell a calculator to perform its main calculation.
calculate(calc, params, activeCases, do.what)
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. |
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.
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.
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.
Ross Boylan
mspathCalculator
,
mspathDistributedCalculator