generator: Generator

Description Usage Arguments Value Examples

Description

Compute the generator of a PDMP. The generator is defined as follows: Let Xₜ be a PDMP with statespace K x D where K ⊂ ℝᵏ and D is the state space for the discrete variable. Let furthermore φˢ(t,i,z) be the dynamics for the continous variables, s = 1,...,k and Λᵢⱼ(z) be the transition rates i → j for i,j ϵ D. Let z* be the new continous values after a jump from x := (i,z) to j. The generator for a function f: K x D → ℝᵏ lying in its domain is defined as

Q(f)(t,x) = Q(f)(t,i,z) := Σ φˢ(t,i,z) ∂f(i,z)/∂zₛ + Σ Λᵢⱼ(z)(f(j,z*) - f(i,z))

where the first sum goes from s = 1 to k and the second sums over all j ϵ D.

Usage

1
2
3
4
generator(obj)

## S4 method for signature 'pdmpModel'
generator(obj)

Arguments

obj

an object of class pdmpModel or one of its subclasses

Value

The generator Q of obj as defined above. This is a function which takes as argument a single function f. The arguments of function f have to be the same as the variables of the process Xₜ and should therefore have the same names and the same order as the variables given in init(obj). The resulting function Q(f) is a function with parameters t, x where t is the time value and x is a named vector with the same names (in the same order) as in init(obj).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
data("simplePdmp")
g <- function(d, f) d*f
generator(simplePdmp)(g)(t = 10, x = c("d" = -1, "f" = 10))

# comparison with theoretic solution:
Qg_theoretic <- function(d, f) d^2-2*d*f
f_values <- seq(from = 0, to = 4, by = 0.01)
Qg_method <- function(d, f) sapply(f, function(fi) 
 generator(simplePdmp)(g)(t = 5, x = c("d" = d, "f" = fi))
)
identical(Qg_theoretic(-1, f_values), Qg_method(-1, f_values))
plot(f_values, Qg_theoretic(1, f_values))
lines(f_values, Qg_method(1, f_values), col = "red", lwd = 3)

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