Replies: 1 comment
-
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.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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