sim_fun_grad: A simple gradient simulation function for testing

View source: R/test_function.R

sim_fun_gradR Documentation

A simple gradient simulation function for testing

Description

This is a toy stochastic gradient system which can have bistability in some conditions. Model specification:

U = x^4 + y^4 + axy + bx + cy

dx/dt = - \partial U/ \partial x + σ dW/dt = - 4x^3 - ay - b + σ dW/dt

dy/dt = - \partial U/ \partial y + σ dW/dt = - 4y^3 - ax - c + σ dW/dt

Usage

sim_fun_grad(
  initial = list(x = 0, y = 0),
  parameter = list(a = -4, b = 0, c = 0, sigmasq = 1),
  length = 1e+05,
  stepsize = 0.01,
  seed = NULL
)

Arguments

initial, parameter

Two sets of parameters. initial contains the initial value of x and y; parameter contains a,b,c, which control the shape of the potential landscape, and sigmasq, which is the square of σ and controls the amplitude of noise.

length

The length of simulation.

stepsize

The step size used in the Euler method.

seed

The initial seed that will be passed to set.seed() function.

Value

A matrix of simulation results.

See Also

sim_fun_nongrad() and batch_simulation().


simlandr documentation built on Nov. 16, 2022, 1:12 a.m.