Skip to contents

EnsembleSummary(sim, ts) computes, at the times ts (by default the saved times of the first trajectory), the componentwise mean u, variance v and the quantiles qlow and qhigh over the trajectories of an EnsembleSolution whose values are solutions. Each is a matrix with one row per time. Solutions are interpolated at ts (piecewise constant for jump processes, where the value at a jump time is the one after it).

Usage

EnsembleSummary(sim, ts = NULL, quantiles = c(0.05, 0.95), idxs = NULL)

Arguments

sim

An EnsembleSolution.

ts

Times.

quantiles

Lower and upper quantile levels.

idxs

Optional variables or expressions to summarize instead of the states.

Value

An EnsembleSummary with fields t, u, v, qlow, qhigh and num_monte.

Examples

prob <- SDEProblem(function(u, p, t) u, function(u, p, t) 0.2 * u, 1, c(0, 1))
sim <- solve(EnsembleProblem(prob), EM(), trajectories = 10, dt = 0.1, seed = 3)
EnsembleSummary(sim, ts = c(0, 0.5, 1))$u
#>          [,1]
#> [1,] 1.000000
#> [2,] 1.635676
#> [3,] 2.615810