SimSLV2: Simulation for Stochastic LV2 model

Description Usage Format Examples

Description

inherit from class SimYuima dX = X (r - C X + M X / (1 + h M X)) dt + Sigma dW X (r - C X + M X / (1 + h M X)) is the drift vector, which include: r - vector of intrinsic growth rates C - competitive interactions matrix, all self-regulation strength is [s], all inter-species competitive strength is [c] M - mutualistic interactions matrix h - handling time Note: we only support mean field approximation Note: we only support the bipartite network of mutualistic interactions Sigma is the diffusion matrix, we assume it's a diagonal matrix W is a vector of Wiener process

Usage

1

Format

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
Class 'R6ClassGenerator' <SimSlv2> object generator
  Inherits from: <SimYuima>
  Public:
    r: 0
    delta: 0
    sigma: 0.02
    rmin: NULL
    set_drift: function (n1, n2) 
    set_diffusion: function (n) 
    set_variables: function (n) 
    set_params: function (n1, n2, r, delta, s, c, h, M, sigma) 
    sim: function (n1, n2, r, delta, s, c, h, M, sigma, steps, stepwise, 
    clone: function (deep = FALSE) 
  Parent env: <environment: namespace:StabEco>
  Locked objects: TRUE
  Locked class: FALSE
  Portable: TRUE 
 - attr(*, "name")= chr "SimSlv2_generator"

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
simSLV2 <- SimSLV2$new()
      simSLV2$set_drift(n1 = 1, n2 = 2)
      simSLV2$set_diffusion(n = 1+2)
      simSLV2$set_variables(n = 1+2)
      simSLV2$set_model()
      simSLV2$set_times(steps = 1000, stepwise = 1)
      simSLV2$set_init(xinit = c(1,1,1))
      simSLV2$set_params(n1 = 1, n2 = 2, r = 1, delta = 0.001, s = 1, c = 0.01, h = 0.5, M = 1 * matrix(c(0, 1, 1, 1, 0, 0, 1, 0, 0), ncol = 3), sigma = 0.01)
      simSLV2$simulate()
      out = simSLV2$get_out()

keepsimpler/StabEco documentation built on May 20, 2019, 8:45 a.m.