Learn R Programming

QPot (version 1.0)

TSPlot: Plot simulation of two-dimensional stochastic differential equations

Description

This function allows you to plot the simulation of simulate two-dimensional stochastic differential equations from TSTraj

Usage

TSPlot(mat, deltat, dim = 1, xlim = "NULL", ylim = "NULL",
  x.lab = "time", dens = TRUE, lwd = 2, line.alpha = 130,
  zero.axes = TRUE, ...)

Arguments

mat
a matrix output from TSTraj.
deltat
numeric value indicating the frequency of stochastic perturbation, as $\Delta t$, used in the function to recaluculate axes if applicable.
dim
dimensions of the plot; dim=1 to plot a timeseries with X and Y on the ordinate axis or dim=2 to plot the trjectories in state space (i.e., X and Y respectively on the abscissa
xlim
numeric vectors of length 2, giving the x coordinate range. Default = 'NULL' automatically sizes plot window.
ylim
numeric vectors of length 2, giving the y coordinate range. Default = 'NULL' automatically sizes plot window.
x.lab
for dim=1, allows user to specify the axis as "time" or "steps," with steps being $time \times \Delta t$
dens
if dens=TRUE, plots a horizontal one-dimensional density plot adjacent to the timerseries.
lwd
line width.
line.alpha
transparency of lines from 0--255.
zero.axes
if TRUE, then axes plotted at X=0 and Y=0.
...
passes arguments to plot.

Examples

Run this code
# First, the parameter values, as found in \\code{\\link{TSTraj}}
	model.state <- c(x = 3, y = 3)
	model.sigma <- 0.2
	model.deltat <- 0.005
	model.time <- 100

# Second, write out the deterministic skeleton of the equations to be simulated,
# as found in \\code{\\link{TSTraj}}
	equationx <- "1.54*x*(1.0-(x/10.14)) - (y*x*x)/(1.0 + x*x)"

# Third, run it, as found in \\code{\\link{TSTraj}}

Run the code above in your browser using DataLab