Failing parameter recovery on truncated data #831
-
|
Hi there, I posted this a couple of weeks ago, but accidentally posted it to Issues instead of Discussions, so I'm moving it here. I have a dataset for an experiment where the response window timed out at a fixed time, which means that on approximately 15% of trials, response and rt are unrecorded. I want to use a DDM to model participant responses, but am a little confused as to whether the As a test, I simulated a dataset using HSSM, and modelled it four ways. First, I used the whole dataset. Second, I truncated it by deleting trials for which the rt was above the 85th percentile. Third, a version where those long trials were marked as -999 and the argument The parameter estimates for each of these models are summarized in this Forest plot. You can see that the estimates from
import hssm
import matplotlib.pyplot as plt
import arviz as az
# Simulate data
v_true, a_true, z_true, t_true = [0.5, 1.5, 0.5, 0.5]
dataset = hssm.simulate_data(
model="ddm",
theta=[v_true, a_true, z_true, t_true],
size=1000,
)
truncated_del = dataset[dataset["rt"] < 3.9] # Approximate 85% quantile
truncated_missing = dataset.copy()
truncated_missing.loc[truncated_missing["rt"] >= 3.9, "rt"] = -999
truncated_missing["deadline"] = 3.9
truncated_deadline = dataset.copy()
truncated_deadline.loc[truncated_missing["rt"] == -999, "rt"] = 3.9
# Create and sample models
full_model = hssm.HSSM(
model="ddm",
data=dataset,
)
truncated_model = hssm.HSSM(
model="ddm",
data=truncated_del,
)
missing_model = hssm.HSSM(
model="ddm",
data=truncated_missing,
missing_data=-999,
loglik_missing_data=r"C:\Users\ddgpa\Downloads\ddm_cpn (1).onnx",
)
deadline_model = hssm.HSSM(
model="ddm",
data=truncated_missing,
deadline="deadline",
loglik_missing_data=r"C:\Users\ddgpa\Downloads\ddm_opn.onnx",
)
full_idata = full_model.sample()
truncated_idata = truncated_model.sample()
missing_idata = missing_model.sample()
deadline_idata = deadline_model.sample()
# Plot
fig, ax = plt.subplots(figsize=(9, 5))
az.plot_forest(
[full_idata, truncated_idata, missing_idata, deadline_idata],
model_names=["Full", "Simple", "Missing", "Deadline"],
combined=True,
ax=ax,
) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
|
Hi @ddgpalmer, as a starter, just want to make sure you are using the correct version of HSSM, Let me try to run your example I will report back. |
Beta Was this translation helpful? Give feedback.
-
|
Ok, here are results from running this on my end. Note 1: Tiny changes in the code so don't forget to copy the code snippet directly. Note 2: Here is a link to a google drive folder with the Note 3: From what I understand about the scenario you are testing for, the correct setup should be to use an Note 4: You might find this preprint of ours interesting omitting omissions
|
Beta Was this translation helpful? Give feedback.


Ok, here are results from running this on my end.
Note 1:
Tiny changes in the code so don't forget to copy the code snippet directly.
Note 2:
Here is a link to a google drive folder with the
opnandcpnI used. We are lagging a bit with making these more comprehensively available through huggingface, it needs one bigger push.opn_cpn files
Note 3:
From what I understand about the scenario you are testing for, the correct setup should be to use an
OPNwithdeadline. TheCPNis more useful for aGo-Nogosituation.Note 4:
You might find this preprint of ours interesting omitting omissions