Probabilistic Graphical Models(PGM) are a very solid way of representing joint probability distributions on a set of random variables. It allows users to do inferences in a computationally efficient way. PGM makes use of independent conditions between the random variables to create a graph structure representing the relationships between different random variables. Further, we can calculate the joint probability distribution of these variables by combining various parameters taken from the graph.

Mainly, there are two types of Graph models:

  • Baysian Graph Models : These models consist of Directed-Cyclic Graph(DAG) and there is always a conditional probability associated with the random variables. These types of models represent a causation between the random variables.
  • Markov Graph Models : These models are undirected graphs and represent non causal relationships between the random variables.

pgmpy is a python framework to work with these types of graph models. Several graph models and inference algorithms are implemented in pgmpy. Pgmpy also allows users to create their own inference algorithm without getting into the details of the source code of it. Let’s get started with the implementation part.

Requirements

Installation

Install pgmpy via pyPI

!pip install pgmpy

#python #statistical-inference #statistics

Probabilistic Graphical Models with Python Code
10.00 GEEK