Replies: 2 comments 1 reply
-
Hi, just a quick response here -- when you simulate data from the
posterior samples (using a posterior predictive check - -see the HSSM
functions that do this) - it simulates from the joint distribution of
parameters. Doing the simulation from posteriors means and stds would not
be as good - both because it doesn't take into account the covariance with
other parameters and because it would assume the posteriors are gaussian
which they need not be.
M
…On Wed, Dec 25, 2024 at 7:09 AM JoeSu112 ***@***.***> wrote:
Hi everyone,
I've been working on experimental data and using DDM (Drift Diffusion
Model) for parameter estimation. Recently, I obtained the estimation
results for each parameter and now I want to simulate data to recover the
original dataset. Below is the code I used for the estimation process:
HDDM_0 = hssm.HSSM(
data=data_0,
model="ddm",
loglik_kind="approx_differentiable",
prior_settings="safe",
include=[
{
"name": "v",
"prior": {
"Intercept": {"name": "Normal", "mu": 0, "sigma": 3},
"month_delayed": {"name": "Normal", "mu": 0, "sigma": 3},
"pay_diff": {"name": "Normal", "mu": 0, "sigma": 3},
"time_advantage": {"name": "Normal", "mu": 0, "sigma": 3},
},
"formula": "v ~ 1 + month_delayed + pay_diff + time_advantage",
"link": "identity",
},
],
)
draws=25000chains=4
infer_HDDM_0 = HDDM_0.sample(
sampler="nuts_numpyro", # type of sampler to choose,
cores=2, # how many cores to use
chains=chains, # how many chains to run
draws=draws, # number of draws from the markov chain
tune=int(draws*0.2), # number of burn-in samples
idata_kwargs=dict(log_likelihood=False), # return log likelihood
)
And here are the estimation results:
parameter mean std
a 1.48326 0.01491
z 0.52278 0.00755
t 0.6727 0.01736
v_month_delayed -0.21165 0.01298
v_pay_diff 0.41775 0.01352
v_Intercept 0.11768 0.01757
Now, I want to use these parameters to perform a simulation and recover
the dataset.
My question is:
1.
Do these parameters follow a joint distribution that I can extract
from the InferenceData object (e.g., infer_HDDM_0.posterior)? If yes, how
can I access this joint distribution so that I can draw a full set of
parameters (e.g., v, a, z, t) for each simulated subject?
2.
Or should I draw each parameter independently using their respective
posterior means and standard deviations?
My intuition is that the Bayesian framework should account for
correlations between parameters, and drawing from the joint distribution
would better preserve this relationship. I would appreciate any guidance or
code snippets that could help me proceed!
Thanks in advance!
—
Reply to this email directly, view it on GitHub
<#615>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAG7TFG3PTZUKHPQBFRVXTL2HKU6ZAVCNFSM6AAAAABUF7C3FGVHI2DSMVQWIX3LMV43ERDJONRXK43TNFXW4OZXG42DGMBWGM>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
JoeSu112
-
The chain gives you samples from the posterior distribution. If you just
took one value of parameters you could simulate a response and RT for each
trial but you want to take into account the uncertainty over the parameters
so you can sample a number of parameters from the chain which will then
simulate a range of choices and RTs expected given the uncertainty
Michael
…On Tue, Jan 14, 2025 at 11:03 AM JoeSu112 ***@***.***> wrote:
Thank you so much for your response!
I came across the sample_posterior_predictive function, but I'm a bit
confused about the "chain" dimension in the sampling result. I had
initially expected there to be one rt and response result for each trial in
the data. Could you help me understand how to interpret this "chain"
dimension and its role in the output?
Thank you again for your help!
—
Reply to this email directly, view it on GitHub
<#615 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAG7TFE4UYKDK4QML45D6E32KUYNZAVCNFSM6AAAAABUF7C3FGVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCOBTGMZTGNI>
.
You are receiving this because you commented.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
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone,
I've been working on experimental data and using DDM (Drift Diffusion Model) for parameter estimation. Recently, I obtained the estimation results for each parameter and now I want to simulate data to recover the original dataset. Below is the code I used for the estimation process:
And here are the estimation results:
Now, I want to use these parameters to perform a simulation and recover the dataset.
My question is:
Do these parameters follow a joint distribution that I can extract from the InferenceData object (e.g., infer_HDDM_0.posterior)? If yes, how can I access this joint distribution so that I can draw a full set of parameters (e.g., v, a, z, t) for each simulated subject?
Or should I draw each parameter independently using their respective posterior means and standard deviations?
My intuition is that the Bayesian framework should account for correlations between parameters, and drawing from the joint distribution would better preserve this relationship. I would appreciate any guidance or code snippets that could help me proceed!
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions