…de.data = TRUE. The change fixes a bug so that the covariates in the resulting simulation data.frame match the covariates in the actual data. Ed Ionides helped me snuff-out this minor bug.
The bug occurred because the simulations are ordered in the data.frame object by the time point rather than the simulation number, but the code assumes that the simulations are sorted by simulation number (see example below).
Let nsim = 2, and let simx-t represent the t-th time point of the x-th simulation. Similarly, let data-t be the covariate at the t-th time point. Then the suggested change is:
What was happening:
sim1-1 = data-1
sim2-1 = data-2
sim1-2 = data-3
sim2-2 = data-4
sim1-3 = data-5
...
What should happen:
sim1-1 = data-1
sim2-1 = data-1
sim1-2 = data-2
sim2-2 = data-2
sim1-3 = data-3
...
…de.data = TRUE. The change fixes a bug so that the covariates in the resulting simulation data.frame match the covariates in the actual data. Ed Ionides helped me snuff-out this minor bug.
The bug occurred because the simulations are ordered in the data.frame object by the time point rather than the simulation number, but the code assumes that the simulations are sorted by simulation number (see example below).
Let nsim = 2, and let simx-t represent the t-th time point of the x-th simulation. Similarly, let data-t be the covariate at the t-th time point. Then the suggested change is:
What was happening: sim1-1 = data-1 sim2-1 = data-2 sim1-2 = data-3 sim2-2 = data-4 sim1-3 = data-5 ...
What should happen: sim1-1 = data-1 sim2-1 = data-1 sim1-2 = data-2 sim2-2 = data-2 sim1-3 = data-3 ...