Replies: 3 comments 4 replies
-
Hi Eduard,
this is not actually an error in the model estimation -- it is not
estimating 90K different parameters for a -- but rather it simply stores
the computed values for each regressor on each observation once the
regressors from that trial are taken into account (ie. the
deterministic outputs of the regression). These are stored in the trace
object so arviz displays them by default. You can simply pass an argument
to arviz to exclude those outputs using e.g. var_names = ['~a']
Michael
Michael J Frank, PhD | Edgar L. Marston Professor
Director, Carney Center for Computational Brain Science
<https://www.brown.edu/carney/ccbs>
Laboratory of Neural Computation and Cognition <https://www.lnccbrown.com/>
Brown University
website <http://ski.clps.brown.edu>
…On Fri, Oct 13, 2023 at 8:01 AM eort ***@***.***> wrote:
Hi all,
I am trying to set up a hierarchical regression on multiple DDM
parameters. In my last attempt, I came across a surprising collection of
nodes when printing out arviz.summary on the model inference data.
Here is the model I set up:
model = hssm.HSSM(data=data, z=0.5, model='ddm',
loglik_kind='approx_differentiable', extra_namespace={"lvl": cfg['drugs']}, hierarchical=True,
include=[
{
"name": "v",
"formula":"v ~ 1 + (1|subj_idx) + coh*C(drug, levels=lvl)",
"link": "identity"
},
{
"name": "a",
"formula":"a ~ C(drug, levels=lvl)",
"link": "identity"
}
])
with this being the associated graph:
![image]model_graph.pdf
<https://github.com/lnccbrown/HSSM/files/12893110/model_graph.pdf>
After the sampling, I checked the summary with arviz and got a table that
has following row indices:
[image: image]
<https://user-images.githubusercontent.com/8819465/274893446-86d90bb3-dae0-49e8-a0e6-27f8e8272283.png>
Critically, there are 60 of v_1|subj_idx[XX] nodes, which matches the
number of subjects I have. However, for a it generated 90563 nodes, which
is the number of trials I have in the dataset, which is not what I want.
It seems that by using the hierarchical flag, and not specifying which
variable in the dataset to use as random factor, hssm uses all row index?
Not sure whether this is intentional, but it appears to be a little odd.
So, if you wanted a random effect only on one parameter, but not on
another, that wouldn't be possible?
Thanks,
Eduard
—
Reply to this email directly, view it on GitHub
<#298>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAG7TFE7QG4J6NFF3BLVBTLX7EUR5AVCNFSM6AAAAAA57BL3WGVHI2DSMVQWIX3LMV43ERDJONRXK43TNFXW4OZVG4ZTENBVGI>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
THere are only 60 nodes v|subject because these are subject-wise
intercepts. Technically there should also be deterministic v nodes for each
trial based on your regression as well, separately from the subject wise
intercepts. You should be able to look at r-hat for all the parameters that
you want to look at by using var_names (to either include selected ones or
exclude others). I think the development team is working on a way to try to
make this less cumbersome so that it doesn't display the deterministics by
default.
…On Fri, Oct 13, 2023 at 8:40 AM eort ***@***.***> wrote:
Ah ok, I see. But are those 60 subject wise v-nodes separate parameters? I
guess I am bit confused why these two parameters (a and v) are treated
differently then.
Is there a way to only select the fitted nodes so that I can check
convergence, etc.? Or do I need to select them individually per model,
based on what I specified?
Thanks in any case!
—
Reply to this email directly, view it on GitHub
<#298 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAG7TFEWQACJQJHGR3VYA33X7EZFDAVCNFSM6AAAAAA57BL3WGVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM3TENZTGUZTC>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Additionally, the Please see the documentation here for more details |
Beta Was this translation helpful? Give feedback.
-
Hi all,
I am trying to set up a hierarchical regression on multiple DDM parameters. In my last attempt, I came across a surprising collection of nodes when printing out arviz.summary on the model inference data.
Here is the model I set up:
with this being the associated graph:
After the sampling, I checked the summary with arviz and got a table that has following row indices:
Critically, there are 60 of
v_1|subj_idx[XX]
nodes, which matches the number of subjects I have. However, for a it generated 90563 a[XXXXX] nodes, which is the number of trials I have in the dataset, which is not what I want.It seems that by using the
hierarchical
flag, and not specifying which variable in the dataset to use as random factor, hssm uses all row index? Not sure whether this is intentional, but it appears to be a little odd. So, if you wanted a random effect only on one parameter, but not on another, that wouldn't be possible?Thanks,
Eduard
Beta Was this translation helpful? Give feedback.
All reactions