Configuration
The default settings of ReMeta are chosen in a way that the toolbox can be used pretty ‘out of the box’.
To change these settings, create an instance of the configuration object, change the desired settings and pass it to the ReMeta instantiation:
import remeta
# create configuration object
cfg = remeta.Configuration()
# change any setting
cfg.some_setting = some_value
# pass configuration to ReMeta
remeta = ReMeta(cfg)Important settings¶
cfg.param_type2_criteria.enable¶
| Setting | Default | Possible values |
|---|---|---|
cfg.param_type2_criteria.enable | 3 | 0, <ncriteria> |
If confidence ratings were provided on a discrete scale with e.g. 4 or 5 available options, it is strongly recommended to set up the number of confidence criteria parameter accordingly. If there are confidence response options, there are confidence criteria.
0 disables confidence criteria.
cfg.normalize_stimuli_by_max¶
| Setting | Default | Possible values |
|---|---|---|
cfg.normalize_stimuli_by_max | False | False, True |
If stimuli are well outside the range [-1; 1], parameter estimation may work less reliably, since many internal settings (like initial parameter guesses) are optimized for this stimulus range. In this case case, either normalize the stimuli beforehand, or use:
cfg.normalize_stimuli_by_max = Truecfg.type2_noise_type¶
| Setting | Default | Possible values |
|---|---|---|
cfg.type2_noise_type | report | 'report', 'readout', 'temperature' |
By default, ReMeta assumes that the dominant source of metacognitive noise is at the level of confidence report, i.e.:
cfg.type2_noise_type = 'report'This is perhaps the settings with the greatest impact on the type 2 stage and it is important to be aware of it. As outlined in Type 2: the metacognitive stage, you may alternatively specify metacognitive noise as an unreliable estimate of one’s own type 1 noise (cfg.type2_noise_type = 'report') or as unreliable readout of type 1 evidence (cfg.type2_noise_type = 'readout').
At this point it is pretty much an open empirical question which source of metacognitive noise is most relevant.
cfg.optim_num_cores¶
| Setting | Default | Possible values |
|---|---|---|
cfg.optim_num_cores | 1 | -1, 1, ... n |
Number of cores used for parameter estimation. -1 means all system cores minus 1.
Other useful settings¶
cfg.skip_type2¶
| Setting | Default | Possible values |
|---|---|---|
cfg.skip_type2 | False | False, True |
Only fit a type 1 model (no confidence data required)
Example:
ds = remeta.load_dataset('type1_only')----------------------------------
..Generative parameters:
Type 1 noise distribution: normal
type1_noise: 0.7
type1_bias: 0.2
..Descriptive statistics:
No. subjects: 1
No. samples: 2000
Accuracy: 78.3% correct
d': 1.6
Choice bias: 7.7%
----------------------------------
cfg = remeta.Configuration()
cfg.skip_type2 = True
rem = remeta.ReMeta(cfg=cfg)
rem.fit(ds.stimuli, ds.choices)Dataset characteristics:
No. subjects: 1
No. samples: 2000
Accuracy: 78.3% correct
d': 1.625
Choice bias: 7.7%
+++ Type 1 level +++
Subject-level estimation (MLE)
.. finished (0.1 secs).
Final report
Parameters estimates (subject-level fit)
[subject] type1_noise: 0.724 ± 0.028
[subject] type1_bias: 0.209 ± 0.024
[subject] Log-likelihood: -948.13 (per sample: -0.4741)
[subject] Fitting time: 0.10 secs
Type 1 level finished
Though the following works as well (fit_type1() instead of fit()):
rem = remeta.ReMeta(cfg=cfg)
rem.fit_type1(ds.stimuli, ds.choices)Dataset characteristics:
No. subjects: 1
No. samples: 2000
Accuracy: 78.3% correct
d': 1.625
Choice bias: 7.7%
+++ Type 1 level +++
Subject-level estimation (MLE)
.. finished (0.1 secs).
Final report
Parameters estimates (subject-level fit)
[subject] type1_noise: 0.724 ± 0.028
[subject] type1_bias: 0.209 ± 0.024
[subject] Log-likelihood: -948.13 (per sample: -0.4741)
[subject] Fitting time: 0.10 secs
Type 1 level finished
cfg.optim_type1_gridsearch & cfg.optim_type2_gridsearch¶
| Setting | Default | Possible values |
|---|---|---|
cfg.optim_type1_gridsearch | False | False, True |
cfg.optim_type2_gridsearch | True | False, True |
By default, type 2 (but not type 1) fitting uses an initial grid search procedure to find the most promising region for gradient-based parameter optimization durch maximum likelihood optimization.
The gridsearch range for a parameter can be defined via
cfg.param_<param_name>.grid_range = <range> For most cases, the default grid ranges are suitable.