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

OOP rearrangement #131

Closed drbenvincent closed 7 years ago

drbenvincent commented 7 years ago

Key aim is to add new classes so that things can get done a bit more elegantly.

Add a new Stochastic variable class

This will be similar to the mcmc.univariate, but streamlined a bit

This will embody our important functions, such as magnitude effect, psychometric functions. But it's parameters will consist of stochastic variables, and have plotting functions.

These new classes should make plotting much easier. We can hopefully get rid of a bunch of code, such as the packaging up of intermediate data structures for plotting purposes.

These new abstract subclasses will take the abstract base class (Model) and make it specialised for a new discount function type.

This should allow for very easy creation of new models Should be able to create new abstract subclasses of Model which deal with different discount functions. Will need a concrete model subclass of this. Will need a JAGS model But that should be about it.

Remaining tasks

Plotting data on discount functions Get data points plotting on discount functions again. This has temporarily disappeared under the new arrangement. A good way to do it would be to have the DiscountFunction class have a data property, which itself will be an object of trial data which knows how to plot itself appropriately.

Changes to plotting of deterministic functions?