Random Variable

Instance of: measurable function

AKA: random quantity, aleatory variable, or stochastic variable

Distinct from:

English: A variable which takes values from a sample space, where a probablity distribution describes which values/sets of values are more likely to be taken.


A random variable is just a function mapping outcomes to some measurement space. \[ X:\Omega \mapsto E \]

The measurement space is usually the reals, \(\mathbb{R}\). The outcomes are formally supposed to be probability spaces, which are defined as triples \((\omega, \mathcal{F}, P)\). Where \(\mathcal{F}\) could be sets of more than 1 of the possible outcomes, and \(P\) maps each possible set to a 0-1 probaility.

\[ P(X \in S)=P({\omega\in \Omega| X(\omega) \in S}) \]

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