Learn R Programming

yuima (version 1.0.81)

setMaps: Maps of a Stochastic Differential Equation

Description

'setMaps' is the constructor of an object of class yuima.Output that describes a map of a SDE

Usage

setMaps(func, yuima, out.var = "", nrow = 1, ncol = 1)

Arguments

func
a matrix or a vector of strings that describe each component of the map.
yuima
an object of class yuima.model that is the SDE.
out.var
label for the output
nrow
dimension of output if func is a vector of string.
ncol
dimension of output if func is a vector of string.

Value

References

Yuima Documentation

Examples

Run this code
# Definition of a yuima model
mod <- setModel(drift=c("a1", "a2"),
  diffusion = matrix(c("s1","0","0","s2"),2,2),
  solve.variable = c("X","Y"))

# Definition of a map
my.Map <- matrix(c("(X+Y)","-X-Y",
  "a*exp(X-a1*t)","b*exp(Y-a2*t)"),
  nrow=2,ncol=2)

# Construction of yuima.Output

yuimaMap <- setMaps(func = my.Map, yuima = mod,
  out.var = c("f11","f21","f12","f22"))

# Simulation of a Map

set.seed(123)
samp <- setSampling(0, 100,n = 1000)
mypar <- list(a=1, b=1, s1=0.1, s2=0.2, a1=0.1, a2=0.1)
sim1 <- simulate(object = yuimaMap, true.parameter = mypar,
  sampling = samp)

# plot

plot(sim1, ylab = yuimaMap@Output@param@out.var,
  main = "simulation Map", cex.main = 0.8)

Run the code above in your browser using DataLab