View source: R/fit-IA-stanfit.R
fit_ideal_adaptor | R Documentation |
Infers a prior and posterior distribution of ideal adaptors from the input data using Stan. Currently, three types of ideal adaptor models are available, each using a conjugate prior over Gaussian or multivariate Gaussian categories:
fit_ideal_adaptor(
staninput,
file = NULL,
file_refit = "never",
file_compress = T,
stanvars = NULL,
backend = "rstan",
save_pars = NULL,
basis = NULL,
chains = 4,
iter = 2000,
warmup = 1000,
init = "random",
control = NULL,
silent = 1,
verbose = F,
stan_model_args = list(),
stanmodel = NULL,
rename = T,
...
)
staninput |
A list of the type returned by |
file |
Either NULL or a character string. In the latter case, the fitted model object is saved
via saveRDS in a file named after the string supplied in file. The .rds extension is added automatically.
If the file already exists, the model from that file will be loaded and returned instead of refitting the model.
As existing files won't be overwritten, you have to manually remove the file in order to refit and save the
model under an existing file name. The file name is stored in the |
file_refit |
Modifies when the fit stored via the |
file_compress |
Logical or a character string, specifying one of the
compression algorithms supported by |
backend |
Character string naming the package to use as the backend for
fitting the Stan model. Options are |
silent |
Verbosity level between |
stan_model_args |
A |
stanmodel |
Name of stanmodel that should be used. Overrides any default selection. |
rename |
For internal use only. |
... |
Additional parameters are passed to |
NIW_ideal_adaptor
: A Normal-Inverse-Wishart (NIW) prior over the ideal adaptor. This is the
default model with multivariate Gaussian categories. Accepts univariate and multivariate input, though
the NIX model should be faster for univariate input.
NIX_ideal_adaptor
: A Normal-Inverse-Chisquare (NIX) prior over the ideal adaptor with with
univariate Gaussian categories. Accepts only univariate input.
MNIX_ideal_adaptor
: Separate NIXs for each of multiple cues that are integrated over during
categorization(cue integration) assuming ideal cue weights based on the relative informativity of each cue.
Accepts univariate and multivariate input, though the NIX model should be faster for univariate input.
In interpreting the inferred parameters, it should be kept in mind that the inferred scatter matrix
(e.g., S_0) for the NIW model) includes
variability from internal perceptual and/or external environmental noise, in addition to the motor
noise that is reflected in production data. This also implies that, if Sigma_0
is provided
by the user it should be arguably convolved with an estimate of perceptual noise. This is particularly
important if the data you're fitting contains test phases without exposure (e.g., pre-exposure tests).
Make sure to read the notes about the Sigma_0
argument in the help page on make_staninput
.
Use methods(class = "ideal_adaptor_stanfit")
for an overview on available methods.
An object of class ideal_adaptor_stanfit
with the fitted stan model.
is.ideal_adaptor_stanfit
for information about ideal_adaptor_stanfit objects,
get_draws
to draw samples from the stanfit.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.