seitlDistanceOscillation | R Documentation |
This positive distance is the mean squared differences between the simulation and the observation, divided by the square of the number of times the simulation oscillates around the observation.
seitlDistanceOscillation(simuTrajObs, data)
simuTrajObs |
|
data |
|
distanceOscillation
## Not run:
# Suppose we observed a time series:
data <- data.frame(time = 1:7, Inc = c(1, 3, 5, 7, 5, 3, 1))
# and we have two simulated time series:
traj1 <- data.frame(time = 1:7, observation = c(3, 5, 7, 9, 7, 5, 3))
traj2 <- data.frame(time = 1:7, observation = c(3, 5, 3, 5, 7, 5, 3))
# traj1 is consistently above data and traj2 oscillates around data:
plot(data$time, data$Inc, t = "l", ylim = c(0, 10))
lines(traj1$time, traj1$observation, col = "red")
lines(traj2$time, traj2$observation, col = "blue")
# While the squared differences are the same, we obtain a smaller distance
# for traj2:
d1 <- seitlDistanceOscillation(traj1, data)
# d1 = 4
d2 <- seitlDistanceOscillation(traj2, data)
# d2 = 1.3
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.