Replies: 1 comment
-
The way you have modeled it here treats blurval hierarchically but not
participants. It is not recommended to use task condition (assuming that is
what blurval is) in a hierarchical way unless you have at least 5
conditions -- otherwise there is not enough data to inform the sigma (see
issue #528).
Instead you can do v ~ 1+ blurval (and then add hierarchy across subjects
later if you want - to do that you would do v ~ 1 + blurval +
(1+blurval|participant_id)).
Setting hierarchical = true only applies to the intercepts and so in
general it is better to fully specify your hierarchical model yourself
Michael
…On Wed, Sep 4, 2024 at 10:49 AM noah3695 ***@***.***> wrote:
Hi HSSM community,
I have a dataset where a total of 26 participants completed a task and I
have roughly 47,000 trials across all participants.
I have run a non-hierarchical model with some success. The
non-hierarchical model was made using:
simple_ddm_model3 = hssm.HSSM(data=data, include=[ { "name": "v",
"formula":"v ~ 1 + (1|blurVal)", } ],)
I've also attached two figures: model fit and traces of the posteriors.
The model seems to fit reasonably well.
modelFit_allSubj_VPrior.png (view on web)
<https://github.com/user-attachments/assets/13287e90-2e73-483b-8b44-1bdab6764482>
plotTracerace_log_likelihood_samplernuts_blackjax_cores8_chains16_draws8000_tune1000.png
(view on web)
<https://github.com/user-attachments/assets/41fe8ffa-d2a1-4294-b64d-10b85ad0e3ea>
.
I ran 16 chains, 8000 samples, and tune-in set to 1000. simple_ddm_model3,
when probed, suggests it is a hierarchical model:
Hierarchical Sequential Sampling Model
Model: ddm
Response variable: rt,response
Likelihood: analytical
Observations: 10457
...
However, I remember there being an argument to creating the model where
you can set hierarchical=True. Examples of this can be found in multiple
other submissions from other members, including, here
<#306>, here
<#304> and here
<#565>.
------------------------------
When I try to run the model with hierarchical=True, i get the following
error(s)
Traceback (most recent call last):
File
~/anaconda3/envs/HSSM/lib/python3.11/site-packages/spyder_kernels/py3compat.py:356
in compat_exec
exec(code, globals, locals)
File ~/Documents/HDDM_modelfit_v1.py:445
HDDM_modelfit_v1(sampler_input, cores_input, chains_input, draws_input,
tune_input)
File ~/Documents/HDDM_modelfit_v1.py:187 in HDDM_modelfit_v1
simple_ddm_model3 = hssm.HSSM(data=cav_data,
File ~/anaconda3/envs/HSSM/lib/python3.11/site-packages/hssm/hssm.py:296
in *init*
self._override_defaults()
File ~/anaconda3/envs/HSSM/lib/python3.11/site-packages/hssm/hssm.py:1010
in _override_defaults
param_obj.override_default_priors_ddm(
File ~/anaconda3/envs/HSSM/lib/python3.11/site-packages/hssm/param.py:214
in override_default_priors_ddm
dm = self._get_design_matrices(data, eval_env)
File ~/anaconda3/envs/HSSM/lib/python3.11/site-packages/hssm/param.py:270
in _get_design_matrices
dm = design_matrices(formula, data=data, extra_namespace=extra_namespace)
File
~/anaconda3/envs/HSSM/lib/python3.11/site-packages/formulae/matrices.py:556
in design_matrices
design = DesignMatrices(description, data, env)
File
~/anaconda3/envs/HSSM/lib/python3.11/site-packages/formulae/matrices.py:58
in *init*
self.response.evaluate(data, env)
File
~/anaconda3/envs/HSSM/lib/python3.11/site-packages/formulae/matrices.py:137
in evaluate
self.term.set_type(self.data, self.env)
File
~/anaconda3/envs/HSSM/lib/python3.11/site-packages/formulae/terms/terms.py:820
in set_type
self.term.set_type(data, env)
File
~/anaconda3/envs/HSSM/lib/python3.11/site-packages/formulae/terms/terms.py:431
in set_type
component.set_type(data)
File
~/anaconda3/envs/HSSM/lib/python3.11/site-packages/formulae/terms/variable.py:90
in set_type
raise ValueError(f"Variable is of an unrecognized type ({type(x)}).")
ValueError: Variable is of an unrecognized type (<class
'pandas.core.series.Series'>).
Traceback (most recent call last):
Cell In[15], line 1
simple3, simple_ddm_model3 =
runfile('/Users/steinbergnj/Documents/HDDM_modelfit_v1.py',
args='nuts_blackjax 8 8 5000 1000')
TypeError: cannot unpack non-iterable NoneType object
------------------------------
Any help to verify if it's already somehow hierarchical, or how to get it
to run hierarchically using the input *hierarchical=True* would be much
appreciated. Thanks!
—
Reply to this email directly, view it on GitHub
<#580>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAG7TFFQ4FKVZIZBV5LYUXDZU4MXPAVCNFSM6AAAAABNUQCWAGVHI2DSMVQWIX3LMV43ERDJONRXK43TNFXW4OZXGEZTOOJYGU>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi HSSM community,
I have a dataset where a total of 26 participants completed a task and I have roughly 47,000 trials across all participants.
I have run a non-hierarchical model with some success. The non-hierarchical model was made using:
simple_ddm_model3 = hssm.HSSM(data=data, include=[ { "name": "v", "formula":"v ~ 1 + (1|blurVal)", } ],)
I've also attached two figures: model fit and traces of the posteriors. The model seems to fit reasonably well.
.
I ran 16 chains, 8000 samples, and tune-in set to 1000. simple_ddm_model3, when probed, suggests it is a hierarchical model:
However, I remember there being an argument to creating the model where you can set hierarchical=True. Examples of this can be found in multiple other submissions from other members, including, here, here and here.
When I try to run the model with hierarchical=True, i get the following error(s)
Traceback (most recent call last):
File ~/anaconda3/envs/HSSM/lib/python3.11/site-packages/spyder_kernels/py3compat.py:356 in compat_exec
exec(code, globals, locals)
File ~/Documents/HDDM_modelfit_v1.py:445
HDDM_modelfit_v1(sampler_input, cores_input, chains_input, draws_input, tune_input)
File ~/Documents/HDDM_modelfit_v1.py:187 in HDDM_modelfit_v1
simple_ddm_model3 = hssm.HSSM(data=cav_data,
File ~/anaconda3/envs/HSSM/lib/python3.11/site-packages/hssm/hssm.py:296 in init
self._override_defaults()
File ~/anaconda3/envs/HSSM/lib/python3.11/site-packages/hssm/hssm.py:1010 in _override_defaults
param_obj.override_default_priors_ddm(
File ~/anaconda3/envs/HSSM/lib/python3.11/site-packages/hssm/param.py:214 in override_default_priors_ddm
dm = self._get_design_matrices(data, eval_env)
File ~/anaconda3/envs/HSSM/lib/python3.11/site-packages/hssm/param.py:270 in _get_design_matrices
dm = design_matrices(formula, data=data, extra_namespace=extra_namespace)
File ~/anaconda3/envs/HSSM/lib/python3.11/site-packages/formulae/matrices.py:556 in design_matrices
design = DesignMatrices(description, data, env)
File ~/anaconda3/envs/HSSM/lib/python3.11/site-packages/formulae/matrices.py:58 in init
self.response.evaluate(data, env)
File ~/anaconda3/envs/HSSM/lib/python3.11/site-packages/formulae/matrices.py:137 in evaluate
self.term.set_type(self.data, self.env)
File ~/anaconda3/envs/HSSM/lib/python3.11/site-packages/formulae/terms/terms.py:820 in set_type
self.term.set_type(data, env)
File ~/anaconda3/envs/HSSM/lib/python3.11/site-packages/formulae/terms/terms.py:431 in set_type
component.set_type(data)
File ~/anaconda3/envs/HSSM/lib/python3.11/site-packages/formulae/terms/variable.py:90 in set_type
raise ValueError(f"Variable is of an unrecognized type ({type(x)}).")
ValueError: Variable is of an unrecognized type (<class 'pandas.core.series.Series'>).
Traceback (most recent call last):
Cell In[15], line 1
simple3, simple_ddm_model3 = runfile('/Users/steinbergnj/Documents/HDDM_modelfit_v1.py', args='nuts_blackjax 8 8 5000 1000')
TypeError: cannot unpack non-iterable NoneType object
Any help to verify if it's already somehow hierarchical, or how to get it to run hierarchically using the input hierarchical=True would be much appreciated. Thanks!
Beta Was this translation helpful? Give feedback.
All reactions