Create dataframe of simulation results
as.data.frame.sdbuildR_sim.Rd
Convert simulation results to a dataframe. The first column is time, followed by all stocks, and then all other auxiliary and flow variables.
Usage
# S3 method for class 'sdbuildR_sim'
as.data.frame(x, ...)
Examples
sfm = xmile("SIR")
sim = simulate(sfm)
head(as.data.frame(sim))
#> time Infected Recovered Susceptible Beta Recovery_Rate Lambda
#> 1 0.00 1.000000 0.00000000 99999.00 2e-05 0.5000000 2.000000e-05
#> 2 0.01 1.015000 0.00500000 99998.98 2e-05 0.5074999 2.030000e-05
#> 3 0.02 1.030225 0.01007500 99998.96 2e-05 0.5151123 2.060449e-05
#> 4 0.03 1.045678 0.01522612 99998.94 2e-05 0.5228389 2.091355e-05
#> 5 0.04 1.061363 0.02045451 99998.92 2e-05 0.5306813 2.122725e-05
#> 6 0.05 1.077283 0.02576132 99998.90 2e-05 0.5386414 2.154566e-05
#> Infection_Rate
#> 1 1.999980
#> 2 2.029979
#> 3 2.060428
#> 4 2.091333
#> 5 2.122702
#> 6 2.154542