sde_2d: Solve arbitrary first order SDE systems

Description Usage Arguments Details Value

View source: R/EulerMaruyama.R

Description

A general Euler scheme implementation for arbitrary first-order SDE systems with two state variables.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
sde_2d(
  IC,
  t0 = 0,
  tn = 1,
  drifts,
  diffusions,
  rho = 0,
  n = 1000,
  plotPhaseSpace = TRUE
)

Arguments

IC

a list of variables with the same names as the non-time input as drifts, in the same order with initial values

t0

initial time

tn

ending time

drifts

a list of drift functions with as many variables as IC, and in the same order with the names

diffusions

a list of volatility functions with as many variables as IC, and in the same order with the names

rho

the correlation factor

n

number of sub-intervals in time-grid

plotPhaseSpace

whether to plot the phase-space graph in the function body

Details

The list of functions must have syntax h(t,x,y) for each element matching the elements of IC as list(x = y0, y = y0) for example.

Value

numeric data.frame


shill1729/sdes documentation built on Aug. 30, 2021, 6:36 p.m.