Probability Mass/Density Function (PMF/PDF)

Instance of: function

AKA: Discrete density function; density; Probability Function

Distinct from:

English: A function that takes in a value, and returns the relative likelihood that a random variable takes on that value. Probability mass functions refer to discrete distributions, e.g. what is the probability that a 6 sided die lands on 5? Probability density functions refer to continuous probability distributions and are usually discussed in terms of ranges or cut ponts, e.g., what is the probability that a sample from a random normal value is above 2?


In the continous case, the probability that a random variable \(X\) takes on a value between \(a\) and \(b\) is the integration of its density over that range. \[ Pr[a \le X \le b]= \int_{a}^{b} f_x(x)dx \]

Where \(a\) and \(b\) are the range of values, and \(f_x\) is the density of the random variable.

Cites: Wikipedia ; Wikidata ; Wolfram




# Create an ephemeral in-memory RSQLite database
#con <- dbConnect(RSQLite::SQLite(), dbname = ":memory:")
#dbWriteTable(con, "mtcars", mtcars)

#Configuration failed because libpq was not found. Try installing:
#* deb: libpq-dev libssl-dev (Debian, Ubuntu, etc)
#Took forever because my file permissions were broken
Loading required package: RPostgres
# Connect to the default postgres database
#I had to follow these instructions and create both a username and database that matched my ubuntu name
con <- dbConnect(RPostgres::Postgres())
import torch