multSim: Multiple simulations of a pdmp model

Description Usage Arguments Details Value See Also Examples

Description

Perform simulations of a PDMP with different seeds and optionally save the results in a rda file.

Usage

1
2
multSim(obj, seeds, filename = NULL, ms = NULL,
  allowDeletion = FALSE, ...)

Arguments

obj

object of class pdmpModel or one of its subclasses

seeds

integer vector with seeds that shall be simulated (different seeds lead to different simulated trajectories)

filename

string which indicates the path where to save the result, i. e. "NameOfFile.rda". In case of a break or an error, already simulated seeds will still be saved there. If filename = NULL, the result will not be saved in a file.

ms

object of class multSim (with existing simulations) that shall be expanded

allowDeletion

logical. If true, seeds with existing simulations stored in ms will be deleted in case they don't appear in the new vector of seeds.

...

additional parameters for method sim

Details

The returned s3 class multSim contains 4 different elements:

If an object ms of class multSim is given as parameter, method multSim will only simulate the seeds that are not simulated yet. You can control if seeds that are already simulated and stored in ms but do not appear in the parameter seeds should be deleted or not. This is done via the parameter allowDeletion.

If the time slot of obj has a larger end value than the pdmpModel stored in ms, i.e. times(obj)["to"] > times(ms$model)["to"], all existing simulations will be expanded to the larger end value.

Slot obj@out is not affected by multSim.

Value

object of class multSim containing simulations for all given seeds

See Also

There are several plot methods for objects of class multSim: plot, plotSeeds, plotTimes, plotStats, hist and density.

Examples

1
2
3
4
5
6
7
8
data("simplePdmp")
m1 <- multSim(simplePdmp, seeds = 1:10)
plot(m1$outputList[[1]])

# expand times:
times(simplePdmp)["to"] <- 20
m2 <- multSim(simplePdmp, seeds = 1:15, ms = m1)
plot(m2$outputList[[15]])

CharlotteJana/pdmpsim documentation built on July 2, 2019, 5:37 a.m.