Comments (6)
I think something along these lines would be feasible. Perhaps the most sensible way would be to change Stochastic.set_value
method to accept an observed
flag.
umbrella.set_value(True, observed=True)
I'm not opposed to your solution either, however, where it is set via the model rather than the stochastic. No reason we can't have both, I suppose. All this would have to do is move stochastics to and from the Model.stochastics and Model.observed_stochastics dictionaries.
from pymc2.
Either way sounds great. I'd be happy to try to implement this. Should it go in pymc or pymc3? I'm not totally sure of the relationship between the two - is pymc3 meant to replace pymc very soon? Is the plan to have pymc3 be backwards compatible with pymc?
from pymc2.
You can try to implement it in either version, though pymc
will be easiest. pymc3
will eventually replace pymc
, but they are likely to coexist for some time. It is a breaking update; though the syntax is very similar, you cannot simply run a pymc
model under pymc3
.
from pymc2.
I would also be interested in this feature for similar reasons to Yarden-- I am training a model with a given set of observations, and then testing how well other observations fit that model. In particular, it would be really useful to have a function to evaluate the logp of a model given observations that are not extrinsic to the model itself. Perhaps these could even be optional arguments passed to the logp function
@stochastic(observed=True)
def my_distribution(**kwargs):
#etc.
my_distribution.logp
#^^ would evaluate with values used at initialization
my_distribution.logp(other_vaues)
#^^ evaluates with values = other_values instead of those used at initialization
from pymc2.
I would also love to have this feature! It would be nice to see how the posterior shifts as new data is observed.
from pymc2.
What I generally do is wrap my model in a function, and use the dataset as an argument. That way, each instance of the model is associated with the new dataset. e.g.
def generate_model(dataset):
<model declaration>
# Likelihood
y = Normal('y', mu, tau, value=dataset['y'], observed=True)
return locals()
model1 = MCMC(generate_model(dataset1))
model2 = MCMC(generate_model(dataset2))
from pymc2.
Related Issues (20)
- Inference with Theano shared variable having missing data HOT 2
- Can't build pymc HOT 6
- pymc.test() error HOT 4
- Can't install PyMC neither through conda nor pip on Windows 7 HOT 2
- Sampling does not start or is very slow on mixture model tutorial HOT 2
- async and await are reserved keywords in python 3.7 HOT 3
- Zstride=1. / spatial_scale, eroDivisionError: float division by zero
- pymc fails to find openblas from numpy HOT 4
- Erroneous documentation for Normal HOT 1
- sample_posterior_predictive produces wrongly shaped output HOT 1
- Error messages during pymc.test()
- Successfully installed but can't import HOT 1
- PYMC 2 warning HOT 8
- Python packages installation error HOT 1
- Sample function (MCMC) running AGONIZINGLY slowly HOT 2
- Truncated pareto
- Why can't PyMC be installed on MAC? HOT 5
- Anaconda installing pymc 2.3.7 not 2.3.8 HOT 3
- Install error in Pymc: module 'pymc' has no attribute 'stochastic_from_dist' HOT 9
- BUG: AttributeError: module 'pymc' has no attribute 'diagnostics' HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pymc2.