setMap: Map of a Stochastic Differential Equation

View source: R/FunctionAndOperators.R

setMapR Documentation

Map of a Stochastic Differential Equation

Description

'setMap' is the constructor of an object of class yuima.Map that describes a map of a SDE

Usage

setMap(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 Map if func is a vector of string.

ncol

dimension of output if func is a vector of string.

Value

The constructor returns an object of class yuima.Map.

Author(s)

The YUIMA Project Team

References

Yuima Documentation

Examples


## Not run: 
# 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.Map

yuimaMap <- setMap(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)


## End(Not run)


yuima documentation built on Dec. 28, 2022, 2:01 a.m.