Description Usage Arguments Examples
This function plots the simulation of two-dimensional stochastic differential equations from TSTraj
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
mat |
a matrix output from |
deltat |
numeric value indicating the frequency of stochastic perturbation, as Δ t, used in the function to recaluculate axes if applicable. |
dim |
dimensions of the plot; |
xlim |
numeric vectors of length 2, giving the x coordinate range. Default |
ylim |
numeric vectors of length 2, giving the y coordinate range. Default |
xaxt.1D |
for |
dens |
if |
lwd |
line width. Defaults to 1. |
line.alpha |
transparency of lines from 0–255. |
zero.axes |
if TRUE, then axes plotted at |
xlab.2D |
a title for the x axis when |
ylab.2D |
a title for the y axis when |
... |
passes arguments to |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | # First, the parameter values, as found in TSTraj
model.state <- c(x = 3, y = 3)
model.sigma <- 0.2
model.deltat <- 0.05
model.time <- 100
# Second, write out the deterministic skeleton of the equations to be simulated,
# as found in TSTraj
#Example 1 from article
equationx <- "1.54*x*(1.0-(x/10.14)) - (y*x*x)/(1.0 + x*x)"
equationy <- "((0.476*x*x*y)/(1 + x*x)) - 0.112590*y*y"
# Third, run it, as found in TSTraj
ModelOut <- TSTraj(y0 = model.state, time = model.time, deltat = model.deltat,
x.rhs = equationx, y.rhs = equationy, sigma = model.sigma)
# Fourth, plot it:
# in 1D
TSPlot(ModelOut, deltat = model.deltat, dim = 1)
# in 2D
TSPlot(ModelOut, deltat = model.deltat, dim = 2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.