Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use nems_db's fitted_params_per_cell utility to improve priors #36

Open
jacobpennington opened this issue Apr 3, 2018 · 2 comments
Open
Assignees
Labels
enhancement New feature or request

Comments

@jacobpennington
Copy link
Contributor

We should be able to use the data we've fitted so far to adjust our default priors accordingly. Found this from scipy today: https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.rv_continuous.fit.html (but maybe @bburan knows of something better) which should give a rough estimate of how well a given distribution type fits the data. @svdavid also mentioned wanting to visualize the fitted parameters somehow. My idea is to create a function/module in that basically does:

  1. get data in a form along the lines of: {'parameter1': [datapoint1, datapoint2 ...], 'paramter2': [...]}
  2. use the scipy function linked above (or some other existing stats utility) to get fitted distributions.
  3. for each parameter, create one plot for each fitted distribution, with the distribution and its parameters overlayed (and some kind of error quantification).

The core function that handles this would be in nems and just expect the data structure to come from some where else (like the nems.modelspec.summary_stats function), but baphy-oriented wrappers in nems_db would make it simple use with our cellid/batch/modelspec idiom.

Also: Maybe fitted_params_per_batch and/or _per_model wrappers would be helpful? Should
just need some simple db queries to get lists of desired cellids, then pass along to the current utility function.

Intending to code this up myself, but thoughts/suggestions on features or changes that sound useful or not-so-useful would be helpful.

@jacobpennington jacobpennington added the enhancement New feature or request label Apr 3, 2018
@jacobpennington jacobpennington self-assigned this Apr 3, 2018
@svdavid
Copy link
Contributor

svdavid commented Apr 4, 2018

This is a great idea. Would be very curious to see the distributions for the various phis!

@jacobpennington
Copy link
Contributor Author

Started on this. Can see some possibly interesting patterns for the dexp parameters. Still todo:

  • Support for parameters stored as arrays (currently only supports scalars).
  • Migrate fitted distribution information into plots somehow (currently printed separately).
  • Move core functionality to main nems repo, keep a nems_db wrapper for cell/batch/ use.
  • Add unit tests for these and for nems/modelspec/summary_stats.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants