drbenvincent / delay-discounting-analysis

Hierarchical Bayesian estimation and hypothesis testing for delay discounting tasks
http://www.inferencelab.com/delay-discounting-analysis/
MIT License
23 stars 9 forks source link

allow user to grab inferred present subjective values #140

Closed drbenvincent closed 7 years ago

drbenvincent commented 7 years ago

Provide a simple command to get access to the inferred present subjective values of the rewards A and B on each trial.

This is a simple matter of adding a getter method in order to return these values. They are coded as VA and VB in the JAGS models.

Allow option to request just the point estimates, or the full distribution.

drbenvincent commented 7 years ago

Hi @benepp I've added a function which allows you to get the inferred present subjective values. Once you've fitted a model, you can just type:

subjective_values = model.get_inferred_present_subjective_values();
display(subjective_values.point_estimates)

assuming you've named the model as model. This will return a structure which (at the moment) contains a table (subjective_values.point_estimates) of information including the point estimates of the present subjective values of each reward.

Can you let me know if this is enough for what you need, or whether you also need to extract the full posterior distribution of inferred present subjective values?

PS. This code currently works on the dev branch. There are a number of things I have to finish off before I merge it into the main branch.

screen_shot_2016-11-13_at_09_46_39