gbmMR: Mean-Reverting geometric brownian motion

Description Usage Arguments Examples

Description

Mean-Reverting geometric brownian motion

Usage

1
2
gbmMR(nspecies, mu = 1, sigma = 1, rho = 0, Tmax = 1, X0 = NULL,
  nsamples = 1000, dt = NULL)

Arguments

nspecies

number of companies to simulate

mu

Number or vector of length nspecies for the drift

sigma

Number of vector of length nspecies for the volatility

Tmax

End of time-window for simulation

X0

initial abundances

nsamples

Number of samples to collect between [0,Tmax]

dt

size of timesteps - an alternative to nsamples for specifying numerical integration. If input, the output will be of length Tmax/dt

Examples

1
2
3
4
5
6
7
library(WrightFisher)
library(plotrix)

x <- gbmMR(10)
par(mfrow=c(1,2))
stackpoly(x$Market,stack=T,main='Market Dynamics')
stackpoly(x$Shares,stack=T,main='Market Share Dynamics')

reptalex/WrightFisher documentation built on May 27, 2019, 5:54 a.m.