[R-sig-dyn-mod] forcing variables (dummy ?) problem
Thomas Petzoldt
Thomas.Petzoldt at TU-Dresden.de
Thu Oct 20 22:26:21 CEST 2011
And the last example can be even simpler (and faster) when approxfun
gets only the required values:
lvfred3 <- lvfred2
initfunc(lvfred3) <- function(obj) {
tmp <- approxfun(c(0, 98, 199, max(times(obj))),
c(0.1, 0.1, 0.2, 0.1), method = "constant", f = 1)
inputs(obj) <- list(signal = tmp)
obj
}
system.time(plot(sim(lvfred3)))
Thomas P.
More information about the R-sig-dynamic-models
mailing list