-
To apply 'instantaneous' impulses to a discrete-time rprocess, I have defined Heaviside-like cumulative time-series via dM <- lookup(ct,t+delta.t)$M - lookup(ct,t)$M Firstly, I would wonder if there might be some more idiomatic way to do this with pomp. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
Help me try to understand what you're up to. Firstly, you say you have a discrete-time process, yet you simultaneously describe a desire to incorporate impulsive forcing, which typically requires a continuous-time setting to make sense. Perhaps I misunderstand. You should also know that the lookup is handled for you, so that there is no need to call |
Beta Was this translation helpful? Give feedback.
-
This is a really good question. Before I address it, I recommend that, since your model is a continuous-time model, you use the On to the main question. There are several ways of implementing the impulsive forcing you describe. I think the conceptually cleanest one is as follows. First, include a covariate consisting of the sum of your Heaviside forcing functions. In other words, the covariate, call it Next, include an additional state variable, say Finally, in the rprocess component, include a statement like
Here, I've written it as though the effect of the forcing is to increment the state variable This is the C snippet form. In an R function, it would be something like
|
Beta Was this translation helpful? Give feedback.
-
Interestingly, I find the following behavior when applying this idiom. Is this expected? I'm using covariate if (V_ > V) {
V = V_;
W = pow(1450/F, 0.3);
} But... when I use the test I can sanitize my code to post a full repro, but wanted to check first that there isn't an explanation straightaway. |
Beta Was this translation helpful? Give feedback.
This is a really good question.
Before I address it, I recommend that, since your model is a continuous-time model, you use the
euler
plug-in rather than thediscrete_time
one. The main difference between these is thatdiscrete_time
assumes that the trajectories of your state process change exactly and only at multiples of the timestepdelta.t
, whileeuler
makes no such assumption.On to the main question. There are several ways of implementing the impulsive forcing you describe. I think the conceptually cleanest one is as follows.
First, include a covariate consisting of the sum of your Heaviside forcing functions. In other words, the covariate, call it
f
, is the cumulative sum of the de…