Skip to contents

Simulate latent process with noise

Usage

# S3 method for class 'ngme_model'
simulate(object, nsim = 1, seed = NULL, ...)

Arguments

object

ngme model specified by f() function

nsim

number of simulations

seed

seed

...

ignored

Value

a realization of latent model

Examples

simulate(f(1:10, model = ar1(rho = 0.4), noise = noise_nig()))
#>          sim_1
#> 1   3.59965280
#> 2   2.16143976
#> 3   1.83093902
#> 4   0.49072576
#> 5   0.73477650
#> 6  -0.01871028
#> 7  -0.59320865
#> 8  -1.42625580
#> 9   0.62286223
#> 10 -0.34549196
simulate(f(rnorm(10), model = rw1(), noise = noise_normal()))
#>           sim_1
#> 1  -0.082776710
#> 2  -0.289084824
#> 3   0.137590451
#> 4  -1.287851405
#> 5  -0.001975066
#> 6   0.310557524
#> 7   0.785071106
#> 8  -0.025509778
#> 9  -0.698995583
#> 10 -0.223224666
simulate(f(1:10, model = ar1(rho = 0.4), noise = noise_t(nu = 5)))
#>         sim_1
#> 1  -0.8615802
#> 2   0.1517142
#> 3   0.4201203
#> 4  -1.5041976
#> 5  -1.4701863
#> 6  -0.2128070
#> 7  -1.3164202
#> 8  -1.7089084
#> 9  -1.7422332
#> 10 -1.2025479