Random generation of behavior streams (based on an alternating renewal process) of a specified length and with specified mean event durations, mean interim times, event distribution, and interim distribution, which are then coded as augmented interval recording data with given interval length and rest length.
r_AIR(
n,
mu,
lambda,
stream_length,
F_event,
F_interim,
interval_length,
rest_length = 0,
equilibrium = TRUE,
p0 = 0,
tuning = 2
)
An array with rows corresponding the number of intervals per session,
columns corresponding to MTS, PIR, and WIR records, all replicated n times.
n
times.
number of behavior streams to generate
mean event duration
mean interim time
length of behavior stream
distribution of event durations. Must be of class eq_dist
.
distribution of interim times. Must be of class eq_dist
.
total interval length
length of any recording time in each interval
logical; if TRUE
, then equilibrium initial conditions are used;
if FALSE
, then p0
is used to determine initial state and normal generating
distributions are used for event durations and interim times.
Initial state probability. Only used if equilibrium = FALSE
, in which case
default is zero (i.e., behavior stream always starts with an interim time).
controls the size of the chunk of random event durations and interim times. Adjusting this may be useful in order to speed computation time .
James Pustejovsky <jepusto@gmail.com>
Generates behavior streams by repeatedly drawing random event durations and random interim times from the distributions as specified, until the sum of the durations and interim times exceeds the requested stream length. Then applies an augmented interval recording filter to the generated behavior streams.
r_AIR(n = 5, mu = 2, lambda = 4, stream_length = 20,
F_event = F_exp(), F_interim = F_exp(),
interval_length = 1, rest_length = 0)
Run the code above in your browser using DataLab