-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
adding BayesNet #3
base: master
Are you sure you want to change the base?
Conversation
Hi Johannes, This looks very interesting. Thanks for sending it along. I would have But I will keep an eye on your project and maybe we can talk about Thanks very much! On Thu, Oct 3, 2013 at 1:31 PM, Johannes Castner
|
That would be great! I'm working on a paper right now that uses Johannes On Thu, Oct 3, 2013 at 1:50 PM, AllenDowney [email protected] wrote:
Johannes "Peace cannot be kept by force; it can only be achieved by understanding."
|
Today I generalized a few things: it now works with negatve causation and with heterogenous causal effects (in the form of edge weights). Johannes |
…uses of other variables. However, right now, those independent variables have to be added, using add_nodes, before edges are added, using add_edges_from. This is not very elegant, but it works for now.
…into the BayesNet object. The default is a beta distribution with alpha=beta=2.
I really like the idea of a Think book on Bayes nets, and probabilistic graph models, in general. Perhaps the most expedient would be some sort of collaboration with David Barber, author of "the pink book" on Bayesian machine learning. That's a fantastic book, with a nice companion toolkit, but alas his code is in MATLAB, which was an unfortunate choice, IMHO. Maybe your book could be titled, "Think Graph." And if you need reviewers or contributors, I'd love to help. -- jdm |
@johndavidmiller Thanks for these comments. This is definitely something I would like to get to some day! @jac2130 I have not forgotten about this issue, but I have been working on other things. I am teaching my Bayesian stats class this fall, which might create the opportunity for me to get back to this. I am looking forward to the possibility of bringing in this capability. |
Dear professor Downey,
I thought that it would be useful to have a class called "BayesNet," which inherits from both, a "DiGraph" class, which is a directed graph in NetworkX and from "Joint", which is your class for joint distributions. Thus, I quickly cooked up such a class, which currently handles binary variables and is encoded according to Pearl's "Noisy-OR" encoding (Pearl 1988). The idea here is that this is a way to quickly build a model of causal relationships between k variables in some system of interest. In particular, I am interested in modeling how people might reason differently about such relationships and how differently structured causal models might be compared in the light of data (I'm following the ideas of cognitive scientists Tom Griffiths and Joshua Tennenbaum). Right now, every independent variable has the same marginal probability 'p', of taking on the value 1, and every caused variable is linked to every one of its causes by the same causal effect parameter "causal_effect". As this is just a quick first try at coding such a thing up, it isn't yet very clean and doesn't yet handle a whole lot (variables are restricted to be binary, independent variables all have the same probability of being 1 and causal effects are all the same). For example, it would be nice to have the possibility of negative causation; what if someone believes that some variables have preventative effects on other variables? Just a beginning, but I'm continuously working on it. If you have any ideas, I'd be greatful!
Johannes