Package: |
poisson |
Type: |
Package |
Version: |
1.0 |
Date: |
2015-10-01 |
License: |
GPL-2 |
The most useful methods are those that simulate scenarios. A scenario consists of many simulated processes, a mean process, and quantile processes. The mean process shows the average number of events through time, i.e. the most likely process path. The simulated paths and the quantile processes inform the analyst about the level of variance about this mean, allowing inference on best and worst outcomes, as well as the most likely outcome.
Imagine a scenario where we expect 5 events per unit of time, on average, and don't expect that average to change. We want to analyse the distribution of paths and hitting times of observing 20 events. To simulate and view the scenario, run:
scen = hpp.scenario(rate = 5, num.events = 20, num.sims = 100)
plot(scen, main='My HPP Scenario')
The mean process values are in scen@x.bar
and the quantile processes are in scen@x.q
.
In contrast, let us now assume that the rate of events will be time-varying. Say we expect the event intensity to start at zero and increase linearly to 100% after three units of time. When event intensity is at 100%, we expect 10 events per unit time. To simulate this scenario, we run:
intensity <- function(t) pmin(t/3, 1)
rate <- 10
num.events <- 100
scen = nhpp.scenario(rate, num.events, num.sims = 100, prob.func=intensity)
plot(scen, main='My NHPP Scenario')