intervalpdf {intRvals} | R Documentation |
Probability density function of an observed interval distribution
Description
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.
Usage
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
)
Arguments
data |
A list of intervals for which to calculate the probability density |
mu |
The mean of the true interval distribution |
sigma |
The standard deviation of the true interval distribution |
p |
The probability that an arrival that marks the start or end of an interval is not observed |
N |
The maximum number of consecutive missed arrivals to take into consideration |
fun |
assumed distribution family of the true interval distribution, one of
" |
trunc |
Use a truncated probability density function with range |
fpp |
Baseline proportion of intervals distributed as a random poisson process with mean arrival rate |
sigma.within |
within-subject standard deviation, only available when |
Details
General
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.
Gamma-distributed intervals
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
.
Normal-distributed intervals
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.
Within and between-subject variation
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)
Value
This function returns a list of points describing the interval distribution
Examples
# 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')