simulate_rw: simulate data from a second order random walk

View source: R/simulate_rw.R

simulate_rwR Documentation

simulate data from a second order random walk

Description

simulate data from a second order random walk

Usage

simulate_rw(
  sigma = NULL,
  tau = NULL,
  length = 10,
  start = 1,
  order = 1,
  n_sim = 1000
)

Arguments

sigma

the standard deviation of the random walk process

tau

the precision of the random walk process

length

the length of the time series

start

the starting values of the time series

order

1 for first order random walk or 2 for second order random walk

n_sim

the number of simulations

Value

a data.frame with simulated time series from the random walk

See Also

Other priors: plot.sim_iid(), plot.sim_rw(), select_change(), select_divergence(), select_poly(), select_quantile(), simulate_iid()

Examples

set.seed(20181202)
x <- simulate_rw(sigma = 0.1, start = -10, length = 40)
head(x)
y <- simulate_rw(sigma = 0.001, start = -10, length = 40, order = 2)
head(y)

inbo/inlatools documentation built on Sept. 17, 2022, 2:13 p.m.