.resample_param | R Documentation |
Generates n
time-series (columns) with a single set of onsets, but
resampled amplitudes/durations for each column if amplitude_sd>0
or duration_sd>0
. Each column also gets independent noise. The result
is a list containing:
time_series
: a matrix_dataset
with T \times n
.
The event_table
uses the first column's amplitude/duration draws.
ampmat
: an n\_events \times n
matrix of per-column amplitudes.
durmat
: an n\_events \times n
matrix of per-column durations.
hrf_info
: info about the HRF.
noise_params
: info about noise generation (type + AR coefficients + SD).
.resample_param(
base,
sd,
dist = c("lognormal", "gamma", "gaussian"),
allow_negative = FALSE
)
base |
Base values to resample from |
sd |
Standard deviation for resampling |
dist |
Distribution to use for resampling |
allow_negative |
Whether to allow negative values |
n |
Number of time-series (columns). |
total_time |
Numeric. Total scan length (seconds). |
TR |
Numeric. Repetition time (seconds). |
hrf |
Hemodynamic response function, e.g. |
n_events |
Number of events (ignored if |
onsets |
Optional numeric vector of event onsets. If |
isi_dist |
One of |
isi_min , isi_max |
For |
isi_rate |
For |
durations |
Numeric, scalar or length- |
duration_sd |
Numeric. If >0, random variation in durations. |
duration_dist |
|
amplitudes |
Numeric, scalar or length- |
amplitude_sd |
Numeric. If >0, random variation in amplitudes. |
amplitude_dist |
|
single_trial |
If TRUE, each event is a separate single-trial regressor that gets summed. |
noise_type |
|
noise_ar |
Numeric vector for AR(1) or AR(2). If missing or insufficient, defaults are used (0.3 for AR(1); c(0.3,0.2) for AR(2)). |
noise_sd |
Std dev of the noise. |
random_seed |
Optional integer for reproducibility. |
verbose |
If TRUE, prints messages. |
If noise_type="ar1"
and you do not provide noise_ar
, we
default to c(0.3)
.
If noise_type="ar2"
and you do not provide a 2-element noise_ar
,
we default to c(0.3, 0.2)
.
Onsets are either provided or generated once for all columns.
Amplitudes/durations are re-sampled inside the loop so each
column can differ randomly. The final arrays ampmat
and durmat
each have one column per time-series.
The matrix_dataset
's event_table
records the first column's
amplitudes/durations. If you need each column's, see ampmat
and
durmat
.
A list containing:
time_series
A matrix_dataset
with T \times n
data
and event_table
for the first column's random draws.
ampmat
An n\_events \times n
numeric matrix of amplitudes.
durmat
An n\_events \times n
numeric matrix of durations.
hrf_info
A list with HRF metadata.
noise_params
A list describing noise generation.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.