Learn R Programming

samplr (version 1.1.0)

CoreABS: CoreABS Object

Description

This is the parent R6 class of the Auto-correlated Bayesian Sampler @ABS, @zhu2024AutocorrelatedBayesianSamplersamplr. It is a sequential sampling model assuming people draw autocorrelated samples from memory or beliefs, i.e., posterior of hypotheses.

Arguments

Public fields

n_chains

an integer of the number of chains for the sampler.

nd_time

a numeric value of the non-decision time (in seconds).

s_nd_time

a numeric value of the inter-trial-variability of the non-decision time (in seconds).

distr_name

a character string indicating the type of the posterior hypothesis distribution.

distr_params

a numeric vector of the additional parameters for the posterior hypothesis distribution.

custom_distr

a list of functions that define the posterior hypothesis distribution.

custom_start

a numeric value of the starting point if "custom_distr" is provided.

sim_results

a data frame for saving the simulation results.

Methods


Method new()

Create a new 'CoreABS' object.

Usage

CoreABS$new(
  n_chains,
  nd_time,
  s_nd_time,
  distr_name = NULL,
  distr_params = NULL,
  custom_distr = NULL,
  custom_start = NULL
)

Arguments

n_chains

an integer of the number of chains for the sampler.

nd_time

a numeric value of the non-decision time (in seconds).

s_nd_time

a numeric value of the inter-trial-variability of the non-decision time (in seconds).

distr_name

a character string indicating the type of the posterior hypothesis distribution. The package currently only supports norm, which represents normal distribution.

distr_params

a numeric vector of the additional parameters for the posterior hypothesis distribution.

custom_distr

a list of functions that define the posterior hypothesis distribution.

custom_start

a numeric value of the starting point if "custom_distr" is provided.

Returns

A new 'CoreABS' object.


Method clone()

The objects of this class are cloneable with this method.

Usage

CoreABS$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

References