simulate data from a second order 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)
#> # A tibble: 6 × 3
#>       x       y replicate
#>   <dbl>   <dbl>     <int>
#> 1   -10  0              1
#> 2    -9 -0.0770         1
#> 3    -8 -0.313          1
#> 4    -7 -0.560          1
#> 5    -6 -0.634          1
#> 6    -5 -0.688          1
y <- simulate_rw(sigma = 0.001, start = -10, length = 40, order = 2)
head(y)
#> # A tibble: 6 × 3
#>       x         y replicate
#>   <dbl>     <dbl>     <int>
#> 1   -10  0                1
#> 2    -9  0                1
#> 3    -8 -0.000880         1
#> 4    -7 -0.00264          1
#> 5    -6 -0.00397          1
#> 6    -5 -0.00490          1