Comments (4)
This is because you filled the missing values with 999999, which is outside the support of the variable. You need to give it a valid value, but not one that occurs in the non-missing data.
Also, note that you don't have to pass plot=False
for observed stochastics. They will not get printed.
from pymc2.
Thanks @fonnesbeck for pointing this out!
So does that means if my observed data contains all possible values inside the support I cannot treat missing data?
E.g. consider the following example:
observed_values = sp.random.binomial(n = 3.0, p = 0.5, size = 100)
print(sp.unique(observed_values))
Output:
[0 1 2 3]
What to choose for the masked value?
mask = sp.zeros_like(observed_values)
mask[0] = True
masked_values = sp.ma.masked_array(observed_values, mask = mask, masked_values = ????)
Is it really necessary that pymc checks for the masked value to be in the support? Because I have the following situation: I do have a model where the n of the binomials actually is a random variable itself. And I'm fitting a number of datasets. That means I would have to check which masked value to use for every dataset which is certainly possible, but sometimes I might not be able to find a masked value. So I would vote for not checking if the missing values are inside the support. Would you agree.
from pymc2.
You can give it a non-integer value in order to avoid the problem that you cite. For example, if you fill with, say, 1.5 that should work.
Its not a matter of PyMC "checking" the the values are inside the support, it is just that PyMC calculates the log-probability at the first iteration, and therefore the values inserted for the missing values at the first iteration have to be valid. If you give discrete values a floating point value, it should end up getting truncated when converted to integers, so that will work.
from pymc2.
Thanks @fonnesbeck, using 1.5 works in my example.
btw: Using the plot = False
option for observed stochastics makes makes sense if there are missing data because it will be plotted otherwise.
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.