Quantum Bayesian Networks

May 29, 2022

Causal Transformers, What Ho Jeeves!

Filed under: Uncategorized — rrtucci @ 11:28 pm

Gulliver023

Two amusing groups in the deep learning community are the Convolutional Neural Netters (CNN) led by  Yann LeCun and the Tranformers (T) . These two groups are in competition with each other. They remind me of the big-endians and little-endians in Gulliver’s Travels, two groups that were at war because they couldn’t agree on which is the proper end to break an egg. The CNN don’t like Causal Inference (CI), but the T have been adopting CI in droves in the last year. I recently serendipitously searched for the two keywords “causal” and “transformer” on google scholar, and got dozens of hits. Check it out!

See also the following tweet with a link to a review about transformers by an OpenAI member (Lilian Weng).  This review shows that CI has made deep inroads in the transformer community in the last year. They are now using causal Bayesian Networks (with deterministic nodes). They don’t call them B nets, but a quick look at this review will convince you that that is exactly what they are .

IMO, the most important cross fertilization between mainstream AI and causal inference (CI) currently occurring is found in transformers (T). DALL-E (OpenAI) and Imagen (Google) are both based on T, and T is increasingly adopting CI.

May 11, 2022

Treasure Trove of Observational/Experimental Datasets in Medicine

Filed under: Uncategorized — rrtucci @ 4:51 pm

Ever since I wrote my open source app JudeasRx, I’ve been hankering for real data examples to apply it to. Three days ago, I came across the following Tweet, which might finally help satisfy that hankering. The tweet asks for medical studies involving both experimental data (RCTs) and observational data (surveys), which are precisely the 2 types of data that JudeasRx takes as input. The tweet seems to have struck a nerve, as it has gotten 105 replies at the writing of this blogpost!

May 7, 2022

Quick Review of Kevin Murphy’s New 2 Volume Machine Learning Encyclopedia

Filed under: Uncategorized — rrtucci @ 10:07 am

Both Volumes.indd

cover2

 

My first encounter with Kevin Murphy’s work was through his “Bayes Net Toolbox” (BNT), a library of tools, written mostly in MatLab, mainly for doing Bayesian Network Inference (Rung 1 of Judea Pearl’s Hierarchy).  Murphy was a Professor at the University of British Columbia (UBC) from 2004 to 2012. Then he resigned from UBC to assume a full time position as a research scientist at Google, where he still works today. While working at UBC, Murphy taught a course in AI which he ultimately compiled into a book entitled “Machine Learning: A Probabilistic Perspective” (1104 pgs., published in 2012). While working at Google, Murphy has greatly expanded his 2012 book into a two tome collection. The first tome was published in paper this year, and the second tome will be published in paper next year. Both tomes are available today, as first drafts, in pdf form, at github:

At over 2000 pages, these two tomes can be fairly described as encyclopedic. Not the type of books you read linearly from page 1 to page 2049.  Even though they are titled “probabilistic machine learning”, they cover all of AI, including many parts of AI that don’t have much to do with probability. (for instance, dimensional reduction). They also provide a solid introduction to the math that is at the foundation of AI (probability, statistics, linear regression, etc.). They also provide lots of python code. Do they cover Causal Inference (CI) too? Yes! The last chapter (63 pages long) of the second volume is dedicated to CI.

Some Differences between pml1+pml2  (2050 pgs) and  my book Bayesuvius (590 pgs) :

  • My book Bayesuvius, even though it’s 30% as long, covers Causal Inference more thoroughly than Murphy’s 2 books.
  • My book Bayesuvius tries to explain all of AI using the unifying principle of Bayesian Networks. Whether it be Causal Inference, Neural Nets, Back propagation, Reinforcement Learning , GANs, decision trees, etc., I try to explain them all using B nets. Murphy’s books don’t have a similar unifying principle. Nothing wrong with that, but they don’t.
  • My chapters are shorter and more numerous. The ratio of equations to words is higher in my book.
  • I intentionally do not include python code in my book. Murphy does in his, although he does separate the computer code fairly well from the text. I use in Bayesuvius a profusion of equations, pictures  (especially DAGs), and pseudo code, but no actual computer code. The reason I wrote Bayesuvius this way is that I feel that books that have a lot of computer code in them don’t age well, once the computer language their code is written in falls out of fashion, which inevitably occurs. I prefer to “factor” the equations and the computer code. I prefer to use books to store equations, and software libraries and jupyter notebooks (as in my software JudeasRx) to store computer code.  There is a modern tendency in AI to use a python snippet instead of a nice equation to explain things.  Having been raised as a physicist, I prefer explaining a theory using equations rather than snippets. 

May 5, 2022

Quantum Computing Academics caught commiting fraud a second time

Filed under: Uncategorized — rrtucci @ 6:00 pm

April 29, 2022

Disastrous products (lead additive in gasoline, freon)

Filed under: Uncategorized — rrtucci @ 11:48 pm

April 16, 2022

Why using BayesiaLab instead of Open Source software is a waste of money, plus if you use BayesiaLab, you will find it very hard to take full advantage of the crazy rich Python ecosystem

Filed under: Uncategorized — rrtucci @ 3:38 am

A friend told me that he was planning to use BayesiaLab for his medical research, and I tried to persuade him to use open source software instead (for example, Graphviz, matplotlib, numpy, Pandas, PyMC3, and my apps Quantum Fog and JudeasRx). He asked me to say a few words about this at a Zoom mini-conference. I put together for the conference the following handout with some pertinent links.

Click to access boris-zoom-april-14-2022.pdf

April 10, 2022

Web3.0: A Libertarian Dystopia, by Münecat

Filed under: Uncategorized — rrtucci @ 4:05 pm

I’ve detested crypto currencies, NFTs and web3.0 for a long time, so I  thoroughly enjoyed watching this video.

This video is excellently researched, written, produced and delivered. I’d give its author Münecat a Pulitzer prize for it, if I could.

The author has a sharp eye and a rebellious iconoclastic spirit, combined with high moral sensitivity and wisdom. She is also a very charismatic and talented artist and performer.

When Bitcoin cult members ask me whether I think quantum computers will derail Bitcoin, I tell them, No, because their fake money will become worthless long before quantum computers can break any crypto codes.

April 5, 2022

Microsoft releases new version of “Azua”, a Python app for doing Causal AI.

Filed under: Uncategorized — rrtucci @ 12:42 am

Check out

I haven’t studied Azua carefully yet, although I intended to do so. Here is my initial impression.

Azua is a Python app for doing Causal Inference. It has had 2 major releases, Sep 2021, and April 2022.  Azua is a team effort by a dozen highly paid Microsofties. It intends to be a very complete “end-to-end” library that covers both Rungs 1 and 2 of Judea Pearl’s causal inference hierarchy. I say it covers rungs 1 and 2 because it uses DAGs and calculates ATE/CATE. To cover Rung 3, it would have to calculate PNS, which it doesn’t. (My software JudeasRx does cover all 3 rungs and calculates ATE/CATE and PNS). Azua claims to be capable of doing personalized medicine. That all depends on how one defines personalized. I’m pretty sure that Judea Pearl would say Azua is incapable of doing personalized medicine properly because it doesn’t calculate PNS intervals (JudeasRx does).
I totally agree with Pearl on this. For reasons I explain in my book Bayesuvius, writing software that purports to do personalized medicine, but does not calculate PNS, is like cooking italian lasagna without using cheese or tomatoes. On the other hand, Azua calculates a lot of things that JudeasRx doesn’t calculate,  like, for example, missing data.

I and my little company www.ar-tiste.xyz will learn to use Azua, and will no doubt find it a useful addition to the growing arsenal of free open source Causal Inference software.

whale-eating-goldfish-judeasrx

March 28, 2022

Ukrainian Sun-Dog

Filed under: Uncategorized — rrtucci @ 10:56 pm

Found this beautiful picture of a Ukrainian sun-dog on the internet. Posting it here in honor of the brave freedom fighters of Ukraine. May you defeat decisively the evil, coward dictator Putin. Glory to Ukraine!

sun-dog

March 5, 2022

Good and Bad Controls go to Monte Carlo

Filed under: Uncategorized — rrtucci @ 8:53 am

confounding_variables

When conducting an experiment to try to decide whether a medical treatment (or a marketing gimmick or a business decision) is being, or will be, effective, one must try to find out what external variables might be confounding the data. These confounders are also called controls. The problem with controls is that they are not all created equal. Controlling the value of a control in an experiment might clarify, or it might hide, the answer to the question of whether the treatment is effective, or not. Judea Pearl et al wrote last year a wonderful paper

in which he explains his method for deciding which controls are good to control and which aren’t. He addresses this question using DAGs (directed acyclic graphs), and his theory of causal inference (CI).

The above paper considers 20 DAGs. The purpose of this blog post is to announce that I have analyzed those 20 DAGs using the “Identifiability Checker” of my free, open source software JudeasRx.  The results of that analysis are contained in the following Jupyter notebooks.

  1. drawings
  2. 1-4
  3. 5-8
  4. 9-11u
  5. 12-15
  6. 16-18
  7. 7up
  8. SUMMARY

I’ve translated each of those 20 DAGs into its own Dot File. I’ve also started a new JudeasRx folder called “dot_atlas” .My “dot_atlas” is devoted to holding just DAGs in the dot file format. I imagine humans all carry a personal dot_atlas in their head. This reminds me of the excellent novel and movie “Cloud Atlas…Everything is connected”.  (In case you don’t know, a dot file is a txt file that contains a description of a DAG. Dot files can be drawn using a rendering engine called graphviz. graphviz is the preferred DAG rendering engine for JudeasRx.)

Final advice for those suffering from DAG-phobia or DAG-aversion:

DAGs are your friends. DAGs should be easy and fun to dream up. After all, I am convinced that DAGs are an integral part of how humans think, so they should come naturally to us.  Nevertheless, many people are scared of, or detest, DAGs. I think it’s because they fail to grasp the following 3 things:

1. DAGs are not unique. Stop thinking that you have to find the unique DAG for the situation being considered. You just have to find a DAG that is a good causal fit for the situation. If a DAG is too complicated, you can always simplify it by merging several nodes into a single more abstract one, or by summing over unwanted nodes.

2. DAGs are roughly ordered from past to present. The arrows of a DAG roughly reflect the passage of time.

3. DAGs represent a scientific hypothesis that can and should be tested with do experiments.

dot_atlas

February 16, 2022

My Identifiability Checker Works! Verified Judea Pearl’s Backdoor and Frontdoor adjustment formulae

Filed under: Uncategorized — rrtucci @ 2:18 am

churchill-victory-sign

My software is working! I am ecstatic.

In a previous blog post entitled “Simple, Monte Carlo driven, Pearl-identifiability checker” which I wrote 2 days ago, I described my future plans to add to my software JudeasRx, an “identifiability checker” based on a very efficient and mature MCMC (Markov Chain Monte Carlo)  Python software library called PyMC3. Well, its first version is done, and it works pretty well. I have written two Jupyter notebooks showing its use. The first notebook verifies Pearl’s backdoor adjustment formula, and the second verifies his frontdoor adjustment formula.

  1. backdoor
  2. frontdoor

The fact that those two formulae were correct was never in doubt. What is exciting to me is that this validates my somewhat novel, stochastic method for checking Pearl-identifiability, and it also shows that the part of the software that I am responsible for, appears to be bug free…so far. It’s non trivial to make all the parts of a complicated program like this one, work well together. One time, about 5 years ago, it took me a whole year to find a subtle bug in one of my complicated programs. That’s the nightmare scenario.

February 13, 2022

Simple, Monte Carlo driven, Pearl-Identifiability Checker

Filed under: Uncategorized — rrtucci @ 7:29 pm

JudeasRx is my open source software for doing personalized causal medicine using the methods invented by Judea Pearl et al.

What’s next for JudeasRx:

A query Q=P(Y=y|do(X)=x, Z=z) is said to be Pearl identifiable within the context of a bnet (Bayesian network) G iff one can calculate a precise value for Q. This is always possible if G does not contain any unobserved nodes. If G does contain unobserved nodes, one can always find bounds for Q. If those bounds collapse to a single point, then we say that query Q is identifiable. It is remarkable that sometimes Q is identifiable even though G has some unobserved nodes. Pearl has given a method based on his “do calculus” for proving algebraically that a query Q is identifiable.

The next thing I will try to implement in JudeasRx is an identifiability checker based on Monte Carlo rather than do-calculus. It will work as follows. Suppose we are given a bnet with nodes X, Y and an arrow X->Y. Assume we are also given the TPMs (Transition Probability matrices) of all nodes except for the unobserved nodes.

  1. Create a bnet G' from bnet G by removing from G all arrows entering node X.
  2. Loop over different “worlds”.  For each “world”, the unobserved nodes are assigned a different randomly chosen TPM.
  3. Calculate using PyMC3, the value of Q for each world. Store the value of Q for all worlds. Then find the minimum and maximum values for Q over all the worlds. If the upper and lower bounds coincide, declare Q to be identifiable.

This Monte Carlo technique can also be used to find a probability distribution for Q, not just bounds for it. And then one can use the maximum of that probability distribution as a point estimate for Q. Professor Pearl has made a very interesting prediction concerning this: that the probability distribution for Q will become flatter and flatter as the number of worlds increases. I will try to check his prediction.

February 9, 2022

JudeasRx can now calculate bounds for Personalized Treatment Effects for a specific DAG using PyMC3

Filed under: Uncategorized — rrtucci @ 5:46 pm

whale-eating-goldfish-judeasrx

The purpose of this blog post is to announce that JudeasRx (my open source software for doing personalized causal medicine using the methods invented by Judea Pearl et al) has reached a new milestone. It can now calculate bounds for personalized treatment effects for a specific DAG using Monte Carlo. Please check it out!

The docstrings in the Python code of JudeasRx, explain in much detail the algorithm behind the code. In addition, the code currently contains 4 Jupyter notebooks illustrating how to use the code. In addition, in the near future, I plan to write more Jupyter notebooks and an ArXiv paper further explaining the algorithm.

January 24, 2022

My pipe dream about JudeasRx: Bounds for Personalized Causal Effects, obtained for any DAG via Monte Carlo

Filed under: Uncategorized — rrtucci @ 10:54 pm

monte-carlo-pi

IMO, JudeasRx (my open source software app for doing personalized causal medicine using the methods invented by Judea Pearl et al)  is in pretty good shape right now, but there are always greener pastures on the other side of the hill.

I keep fantasizing about adding to JudeasRx the following futuristic feature. I would like for the user to be able to enter a DAG into the app, and the app then doing some Monte Carlo based on that DAG, to calculate the bounds on various personalized causal effects like PNS and EU. This is not a new idea to Judea Pearl. Here is a quote from his Causality (2nd edition) book, Chapter 8, page  277:

To obtain an estimate of the posterior distribution of ACE(X \rightarrow Y) , an approximation technique known as Gibbs sampling can be used (Robert and Casella 1999). A graphical version of this technique, called “stochastic simulation,” is described in Pearl (1988b, p. 210); the details (as applied to the graph of Figure 8.4) are discussed in Chickering and Pearl (1997). Here we present typical results,in the form of histograms, that demonstrate the general applicability of this technique to
problems of causal inference.

In the last 5 years, 2 students that got their PhD under Pearl, Scott Mueller and Ang Li, have published with Pearl, papers that calculate ANALYTICALLY the bounds on PNS/EU for special DAGs. So I see no reason why you could not calculate the same bounds STOCHASTICALLY, via Monte Carlo, for an arbitrary DAG. I already have some Python software that I wrote long ago for doing Monte Carlo on Bayesian Networks. Time to bring it out of mothballs. And here is a nice StackExchange article explaining the basics of how to sample from a Bayesian Network.

If we take this paper by Tian and Pearl, published in the year 2000, as the time zero for the Personalized Causal Effects revolution,  then I find it quite amazing that 22 years later, there is still no software that can do what I am requesting in this blog post. (Or is there? Please tell me if there is.)

Today, I begin steering JudeasRx in that direction, towards a new world, I hope.

January 23, 2022

Asymptotic Notation, my mnemonic

Filed under: Uncategorized — rrtucci @ 4:53 am

Computer scientists, especially the theoretical type, are infatuated with complexity theory, which uses the language of big-O. I don’t use complexity theory much in my line of work. But occasionally, I come across some result that uses this big-O notation. I would like to get the gist of what they are saying, so I’ve been forced to take a crash course on the Big-O language via Wikipedia’s wonderful entry on this subject.

First thing I realized was that Big-O is not a ranch in Texas. Second thing I noticed is that there are more than half a dozen variations on the big-O notation: O, o,  \Theta, \Omega,\omega, \sim, .... I can understand the definitions well enough, but I have a hard time remembering which symbol stands for what. So I came up with a mnemonic for the 3 most common types of Big-O notations. I decided  it looks like a bald, bow-legged, fat person with a belt.

big-o

asymptotic-notation

« Previous PageNext Page »

Blog at WordPress.com.