Observed intervals are assumed to be sampled through observation of continuous distinct arrivals in time. Two subsequently observed arrivals mark the start and end of an interval. The probability that an arrival is not observed can be nonzero, leading to observed intervals at integer multiples of the true interval.
intervalpdf(
data = seq(0, 1000),
mu = 200,
sigma = 40,
p = 0.3,
N = 5L,
fun = "gamma",
trunc = c(0, Inf),
fpp = 0,
sigma.within = NA
)
A list of intervals for which to calculate the probability density
The mean of the true interval distribution
The standard deviation of the true interval distribution
The probability that an arrival that marks the start or end of an interval is not observed
The maximum number of consecutive missed arrivals to take into consideration
Use a truncated probability density function with range trunc
Baseline proportion of intervals distributed as a random poisson process with mean arrival rate mu
within-subject standard deviation, only available when fun
is "normal"
This function returns a list of points describing the interval distribution
intervals x are assumed to follow a standard distribution (either a normal or gamma distribution) with probability density function \(\phi(x|\mu,\sigma)\) with \(\mu\) the mean arrival interval and \(\sigma\) its associated standard deviation. The probability density function \(\phi_{obs}\) of observed arrival intervals in a scenario where the probability to not observe an arrival is nonzero, will be a superposition of several standard distributions, at multiples of the fundamental mean arrival interval. Standard distribution \(i\) will correspond to those intervals where \(i\) arrivals have been missed consecutively. If \(p\) equals this probability of not observing an arrival, then the probability \(P(i)\) to miss \(i\) consecutive arrivals equals $$P(i)=p^i-p^{i+1}$$ The width of standard distribution i will be broadened relative to the fundamental, according to standard uncertainty propagation in the case of addition. Both in the case of normal and gamma-distributed intervals (see next subsections) we may write for the observed probability density function, \(\phi_{obs}\): $$\phi_{obs}(x | \mu, \sigma, p)=\sum_{i=1}^\infty \phi_{obs}(x,i | \mu,\sigma,p)$$ with $$\phi_{obs}(x,i | \mu, \sigma, p)= P(i-1) \phi(x | i \mu,\sqrt i \sigma)$$ In practice, this probability density function is well approximate when the infinite sum is capped at a finite integer N. Be default the sum is ran up to N=5.
By default intervals x are assumed to follow a Gamma (GammaDist) distribution \(Gamma(\mu,\sigma)\)~dgamma(shape=
\(\mu^2/\sigma^2\), scale=
\(\sigma^2/\mu)\)
with a probability density function \(\phi(x)\):
$$\phi(x|\mu,\sigma)~Gamma(\mu,\sigma)$$
which has a mean \(\mu\) and standard deviation \(\sigma\).
intervals x may also be assumed to follow a Normal distribution \(N(\mu,\sigma)\)~dnorm(mean=
\(\mu\),sd=
\(\sigma)\),
with a probability density function \(\phi(x)\):
$$\phi(x|\mu,\sigma)~N(\mu,\sigma)$$
which also has a mean \(\mu\) and standard deviation \(\sigma\). Because intervals
are by definition non-negative, the Normal distribution is always truncated at zero.
In the limit that \(\mu>\sigma\) the gamma distribution tends to the normal distribution.
To account for witin-subject and between-subject differences in mean interval length we define \(\sigma_w\) as within-subject standard deviation in interval length, and \(\sigma_b\) as between-subject standard deviation in interval length, with \(\sigma^2 = \sigma^2_b + \sigma^2_w\). In the normal limit (\(\mu>\sigma\)) the population pdf will be a convolution between \(\phi(x|\mu,\sigma_b)\) and \(\phi(x|\mu,\sigma_w)\) equal to: $$\phi_{obs}(x | \mu, \sigma,\sigma_w,p)=\sum_{i=1}^\infty P(i-1) \phi(x | i \mu,\sqrt i \sigma)$$
# NOT RUN {
# a low probability of not observing an arrival
# results in an observed PDF with primarily
# a single peak, with a mean and standard
# deviation almost identical to the true interval
# distribution:
plot(intervalpdf(mu=200,sigma=40,p=0.01),type='l',col='red')
# a higher probability to miss an arrival
# results in an observed PDF with multiple
# peaks at integer multiples of the mean of the true
# interval distribution
plot(intervalpdf(mu=200,sigma=40,p=0.4),type='l',col='red')
# }
Run the code above in your browser using DataLab