Folds observed arrival intervals with missed observations back to their most likely fundamental interval
fold(object, take.sample = F, sigma.within = NA, silent = F)
an object of class intRvals
, usually a result of a call to estinterval
when TRUE
the number of folds of the fundamental interval is sampled randomly, taking into account the probability weight of each possibility. When FALSE
the fold with the highest probability weight is taken.
(optional) numeric value with an assumed within-group/subject standard deviation, or 'auto
' to estimate it automatically using partition.
logical, if TRUE
print no text to console
numeric vector with intervals folded into the fundamental interval
Arrival intervals containing missed observations are folded to their most likely fundamental interval according to a fit of the distribution of intervals by estinterval.
There is inherent uncertainty on how many missed arrival events an observed interval contains, and therefore to which fundamental interval it should be folded. Intervals folded to the fundamental can therefore introduce extra unexplained variance.
The default is to fold intervals to the
fundamental with the highest probability weight (take.sample = F
). Alternatively, randomly sampled intervals
can be generated, that take into account the probability weights of each possible fold (take.sample = T
).
Intervals x
are transformed to their fundamental interval according to
i-1
the estimated number of missed observations within the interval. This transformation scales appropriately
with the expected broadening of the standard distributions i
in intervalpdf.
When no sigma.within
is provided,
When sigma.within
is 'auto
', sigma.within
is estimated using partition.
When sigma.within
is a user-specified numeric value or 'auto
', data
argument equals to the intervals of the group,
its sigma
argument equal to sigma.within
, and its remaining arguments taken from object
.
Intervals assigned to the fpp
component (see estinterval) are not
folded, and return as NA
values.
# NOT RUN {
dr=estinterval(goosedrop$interval,group=goosedrop$bout_id)
# fold assuming no within-group variation:
interval.fundamental=fold(dr)
# test whether there is evidence for within-group variation:
partition(dr)$`p<alpha` #> TRUE
# there is evidence, therefore better to fold
# while accounting for within-group variation:
interval.fundamental=fold(dr,sigma.within='auto')
# }
Run the code above in your browser using DataLab