Skip to contents

Returns an R function g(u, p, t) evaluating the noise equations of a compiled stochastic system: a vector for diagonal and scalar noise, a matrix (one column per Wiener process) for general noise. For systems with delays the function is g(u, h, p, t) with h(p, t) the history.

Usage

generate_diffusion_function(sys, ...)

Arguments

sys

A complete System with noise equations.

...

Unused.

Value

An R function.

Examples

t <- t_nounits; D <- D_nounits
variables("x(t)"); parameters("a", "b")
B <- Brownian("B")
sys <- mtkcompile(System(list(D(x) ~ a * x + b * x * B), t, name = "gbm"))
g <- generate_diffusion_function(sys)
g(2, c(1, 0.5), 0)
#> [1] 2