Docsity

Machine Learning complete cheatsheet, Exercises of Mathematics

Partial preview of the text

Download Machine Learning complete cheatsheet and more Exercises Mathematics in PDF only on Docsity!

https://github.com/soulmachine/machine-learning-cheat-sheet

[email protected]

Machine Learning Cheat Sheet

Classical equations, diagrams and tricks in machine learning

February 12, 2015

ii

©2013 soulmachine Except where otherwise noted, This document is licensed under a Creative Commons Attribution-ShareAlike 3. Unported (CC BY-SA3.0) license (http://creativecommons.org/licenses/by/3.0/).

Contents

Contents.................................... v

Preface vii

10.5.1 d-separation and the Bayes

  • 1 Introduction Notation xiii
    • 1.1 Types of machine learning
      • model 1.2 Three elements of a machine learning
      • 1.2.1 Representation
      • 1.2.2 Evaluation
      • 1.2.3 Optimization
    • 1.3 Some basic concepts - models 1.3.1 Parametric vs non-parametric - classifier: K-nearest neighbours 1.3.2 A simple non-parametric
      • 1.3.3 Overfitting
      • 1.3.4 Cross validation
      • 1.3.5 Model selection
  • 2 Probability
    • 2.1 Frequentists vs. Bayesians
    • 2.2 A brief review of probability theory
      • 2.2.1 Basic concepts
      • 2.2.2 Mutivariate random variables
      • 2.2.3 Bayes rule
        • independence 2.2.4 Independence and conditional
      • 2.2.5 Quantiles
      • 2.2.6 Mean and variance
    • 2.3 Some common discrete distributions - distributions 2.3.1 The Bernoulli and binomial - multinomial distributions 2.3.2 The multinoulli and
      • 2.3.3 The Poisson distribution
      • 2.3.4 The empirical distribution
    • 2.4 Some common continuous distributions
      • 2.4.1 Gaussian (normal) distribution
      • 2.4.2 Student’s t-distribution
      • 2.4.3 The Laplace distribution
      • 2.4.4 The gamma distribution
      • 2.4.5 The beta distribution
      • 2.4.6 Pareto distribution
    • 2.5 Joint probability distributions
      • 2.5.1 Covariance and correlation
        • distribution 2.5.2 Multivariate Gaussian - t-distribution 2.5.3 Multivariate Student’s - 2.5.4 Dirichlet distribution - 2.6 Transformations of random variables - 2.6.1 Linear transformations - 2.6.2 General transformations - 2.6.3 Central limit theorem - 2.7 Monte Carlo approximation - 2.8 Information theory - 2.8.1 Entropy - 2.8.2 KL divergence - 2.8.3 Mutual information
          • 3 Generative models for discrete data
            • 3.1 Generative classifier
            • 3.2 Bayesian concept learning
              • 3.2.1 Likelihood
              • 3.2.2 Prior
              • 3.2.3 Posterior
              • 3.2.4 Posterior predictive distribution
            • 3.3 The beta-binomial model
              • 3.3.1 Likelihood
              • 3.3.2 Prior
              • 3.3.3 Posterior
              • 3.3.4 Posterior predictive distribution
            • 3.4 The Dirichlet-multinomial model
              • 3.4.1 Likelihood
              • 3.4.2 Prior
              • 3.4.3 Posterior
              • 3.4.4 Posterior predictive distribution
            • 3.5 Naive Bayes classifiers
              • 3.5.1 Optimization
              • 3.5.2 Using the model for prediction
              • 3.5.3 The log-sum-exp trick
                • mutual information 3.5.4 Feature selection using
                • bag of words 3.5.5 Classifying documents using
          • 4 Gaussian Models
            • 4.1 Basics
              • 4.1.1 MLE for a MVN
                • of the Gaussian * 4.1.2 Maximum entropy derivation
            • 4.2 Gaussian discriminant analysis - analysis (QDA) 4.2.1 Quadratic discriminant
        • (LDA) 4.2.2 Linear discriminant analysis
      • 4.2.3 Two-class LDA
      • 4.2.4 MLE for discriminant analysis
        • overfitting 4.2.5 Strategies for preventing
      • 4.2.6 Regularized LDA *
      • 4.2.7 Diagonal LDA
        • classifier * 4.2.8 Nearest shrunken centroids
      • distributions 4.3 Inference in jointly Gaussian
      • 4.3.1 Statement of the result
      • 4.3.2 Examples
    • 4.4 Linear Gaussian systems
      • 4.4.1 Statement of the result
    • 4.5 Digression: The Wishart distribution *
    • 4.6 Inferring the parameters of an MVN
      • 4.6.1 Posterior distribution of m
      • 4.6.2 Posterior distribution of S *
        • and S * 4.6.3 Posterior distribution of m
        • precisions * 4.6.4 Sensor fusion with unknown
  • 5 Bayesian statistics
    • 5.1 Introduction
    • 5.2 Summarizing posterior distributions
      • 5.2.1 MAP estimation
      • 5.2.2 Credible intervals
        • proportions 5.2.3 Inference for a difference in
    • 5.3 Bayesian model selection
      • 5.3.1 Bayesian Occam’s razor
        • likelihood (evidence) 5.3.2 Computing the marginal
      • 5.3.3 Bayes factors
    • 5.4 Priors
      • 5.4.1 Uninformative priors
      • 5.4.2 Robust priors
      • 5.4.3 Mixtures of conjugate priors
    • 5.5 Hierarchical Bayes
    • 5.6 Empirical Bayes
    • 5.7 Bayesian decision theory - loss functions 5.7.1 Bayes estimators for common - negative tradeoff 5.7.2 The false positive vs false
  • 6 Frequentist statistics
    • 6.1 Sampling distribution of an estimator
      • 6.1.1 Bootstrap
        • MLE * 6.1.2 Large sample theory for the - 6.2 Frequentist decision theory - 6.3 Desirable properties of estimators - 6.4 Empirical risk minimization - 6.4.1 Regularized risk minimization - 6.4.2 Structural risk minimization - cross validation 6.4.3 Estimating the risk using - theory * using statistical learning - 6.4.5 Surrogate loss functions - 6.5 Pathologies of frequentist statistics *
          • 7 Linear Regression
            • 7.1 Introduction
            • 7.2 Representation
            • 7.3 MLE
              • 7.3.1 OLS
              • 7.3.2 SGD
            • 7.4 Ridge regression(MAP)
              • 7.4.1 Basic idea
                • computation * 7.4.2 Numerically stable
              • 7.4.3 Connection with PCA *
                • data 7.4.4 Regularization effects of big
            • 7.5 Bayesian linear regression
          • 8 Logistic Regression
            • 8.1 Representation
            • 8.2 Optimization
              • 8.2.1 MLE
              • 8.2.2 MAP
            • 8.3 Multinomial logistic regression
              • 8.3.1 Representation
              • 8.3.2 MLE
              • 8.3.3 MAP
            • 8.4 Bayesian logistic regression
              • 8.4.1 Laplace approximation
              • 8.4.2 Derivation of the BIC
                • logistic regression 8.4.3 Gaussian approximation for
                • predictive 8.4.4 Approximating the posterior
                • detection) * 8.4.5 Residual analysis (outlier
              • optimization 8.5 Online learning and stochastic
              • 8.5.1 The perceptron algorithm
            • 8.6 Generative vs discriminative classifiers
              • 8.6.1 Pros and cons of each approach
              • 8.6.2 Dealing with missing data
                • analysis (FLDA) * 8.6.3 Fishers linear discriminant
    • exponential family 9 Generalized linear models and the
    • 9.1 The exponential family
      • 9.1.1 Definition
      • 9.1.2 Examples
      • 9.1.3 Log partition function
      • 9.1.4 MLE for the exponential family
        • family 9.1.5 Bayes for the exponential
        • of the exponential family * 9.1.6 Maximum entropy derivation
    • 9.2 Generalized linear models (GLMs)
      • 9.2.1 Basics
    • 9.3 Probit regression
    • 9.4 Multi-task learning
  • 10 Directed graphical models (Bayes nets)
    • 10.1 Introduction
      • 10.1.1 Chain rule
      • 10.1.2 Conditional independence
      • 10.1.3 Graphical models
      • 10.1.4 Directed graphical model
    • 10.2 Examples
      • 10.2.1 Naive Bayes classifiers
        • models 10.2.2 Markov and hidden Markov
    • 10.3 Inference
    • 10.4 Learning
      • 10.4.1 Learning from complete data
        • latent variables 10.4.2 Learning with missing and/or
      • of DGMs 10.5 Conditional independence properties
        • Markov properties) Ball algorithm (global
        • DGMs 10.5.2 Other Markov properties of
        • conditionals 10.5.3 Markov blanket and full
      • 10.5.4 Multinoulli Learning
    • 10.6 Influence (decision) diagrams *
  • 11 Mixture models and the EM algorithm
    • 11.1 Latent variable models
    • 11.2 Mixture models
      • 11.2.1 Mixtures of Gaussians
      • 11.2.2 Mixtures of multinoullis
        • clustering 11.2.3 Using mixture models for
      • 11.2.4 Mixtures of experts
    • 11.3 Parameter estimation for mixture models
      • 11.3.1 Unidentifiability - is non-convex 11.3.2 Computing a MAP estimate - 11.4 The EM algorithm - 11.4.1 Introduction - 11.4.2 Basic idea - 11.4.3 EM for GMMs - 11.4.4 EM for K-means - 11.4.5 EM for mixture of experts - variables 11.4.6 EM for DGMs with hidden - distribution * 11.4.7 EM for the Student - 11.4.8 EM for probit regression * - 11.4.9 Derivation of the Q function - Algorithm * 11.4.10 Convergence of the EM - Algorithm * 11.4.11 Generalization of EM - 11.4.12 Online EM - 11.4.13 Other EM variants * - models 11.5 Model selection for latent variable - probabilistic models 11.5.1 Model selection for - non-probabilistic methods 11.5.2 Model selection for - 11.6 Fitting models with missing data - with missing data 11.6.1 EM for the MLE of an MVN - 12 Latent linear models - 12.1 Factor analysis - parameterization of an MVN 12.1.1 FA is a low rank - 12.1.2 Inference of the latent factors - 12.1.3 Unidentifiability - 12.1.4 Mixtures of factor analysers - 12.1.5 EM for factor analysis models - missing data 12.1.6 Fitting FA models with - 12.2 Principal components analysis (PCA) - 12.2.1 Classical PCA - (SVD) 12.2.2 Singular value decomposition - 12.2.3 Probabilistic PCA - 12.2.4 EM algorithm for PCA - dimensions 12.3 Choosing the number of latent - 12.3.1 Model selection for FA/PPCA - 12.3.2 Model selection for PCA - 12.4 PCA for categorical data - 12.5 PCA for paired and multi-view data - factor regression) 12.5.1 Supervised PCA (latent
      • 12.5.2 Discriminative supervised PCA viii Preface
      • 12.5.3 Canonical correlation analysis
    • 12.6 Independent Component Analysis (ICA)
      • 12.6.1 Maximum likelihood estimation
      • 12.6.2 The FastICA algorithm
      • 12.6.3 Using EM
      • 12.6.4 Other estimation principles *
  • 13 Sparse linear models
  • 14 Kernels
    • 14.1 Introduction
    • 14.2 Kernel functions
      • 14.2.1 RBF kernels
      • 14.2.2 TF-IDF kernels
        • kernels 14.2.3 Mercer (positive definite)
      • 14.2.4 Linear kernels
      • 14.2.5 Matern kernels
      • 14.2.6 String kernels
      • 14.2.7 Pyramid match kernels
        • probabilistic generative models 14.2.8 Kernels derived from
    • 14.3 Using kernels inside GLMs
      • 14.3.1 Kernel machines
        • sparse vector machines 14.3.2 L1VMs, RVMs, and other
    • 14.4 The kernel trick
      • 14.4.1 Kernelized KNN
        • clustering 14.4.2 Kernelized K-medoids
      • 14.4.3 Kernelized ridge regression
      • 14.4.4 Kernel PCA
    • 14.5 Support vector machines (SVMs)
      • 14.5.1 SVMs for classification
      • 14.5.2 SVMs for regression
      • 14.5.3 Choosing C
        • of SVMs 14.5.4 A probabilistic interpretation
      • 14.5.5 Summary of key points
      • methods 14.6 Comparison of discriminative kernel
    • 14.7 Kernels for building generative models
  • 15 Gaussian processes
    • 15.1 Introduction
    • 15.2 GPs for regression
    • 15.3 GPs meet GLMs
    • 15.4 Connection with other methods
    • 15.5 GP latent variable model
      • datasets 15.6 Approximation methods for large - 16 Adaptive basis function models - 16.1 AdaBoost - 16.1.1 Representation - 16.1.2 Evaluation - 16.1.3 Optimization - training error of AdaBoost 16.1.4 The upper bound of the - 17 Hidden markov Model - 17.1 Introduction - 17.2 Markov models - 18 State space models - random fields) 19 Undirected graphical models (Markov - 20 Exact inference for graphical models - 21 Variational inference - 22 More variational inference - 23 Monte Carlo inference - (MCMC)inference 24 Markov chain Monte Carlo - 24.1 Introduction - 24.2 Metropolis Hastings algorithm - 24.3 Gibbs sampling - 24.4 Speed and accuracy of MCMC - 24.5 Auxiliary variable MCMC * - 25 Clustering - 26 Graphical model structure learning - 27 Latent variable models for discrete data - 27.1 Introduction - 27.2 Distributed state LVMs for discrete data - 28 Deep learning - A Optimization methods - A.1 Convexity - A.2 Gradient descent - A.2.1 Stochastic gradient descent - A.2.2 Batch gradient descent - A.2.3 Line search - A.2.4 Momentum term - A.3 Lagrange duality - A.3.1 Primal form - A.3.2 Dual form - A.4 Newton’s method - A.5 Quasi-Newton method - A.5.1 DFP

List of Contributors

Wei Zhang PhD candidate at the Institute of Software, Chinese Academy of Sciences (ISCAS), Beijing, P.R.CHINA, e-mail: [email protected], has written chapters of Naive Bayes and SVM.

Fei Pan Master at Beijing University of Technology, Beijing, P.R.CHINA, e-mail: [email protected], has written chapters of KMeans, AdaBoost.

Yong Li PhD candidate at the Institute of Automation of the Chinese Academy of Sciences (CASIA), Beijing, P.R.CHINA, e-mail: [email protected], has written chapters of Logistic Regression.

Jiankou Li PhD candidate at the Institute of Software, Chinese Academy of Sciences (ISCAS), Beijing, P.R.CHINA, e-mail: [email protected], has written chapters of BayesNet.

xi

Notation

Introduction

It is very difficult to come up with a single, consistent notation to cover the wide variety of data, models and algorithms that we discuss. Furthermore, conventions difer between machine learning and statistics, and between different books and papers. Nevertheless, we have tried to be as consistent as possible. Below we summarize most of the notation used in this book, although individual sections may introduce new notation. Note also that the same symbol may have different meanings depending on the context, although we try to avoid this where possible.

General math notation

Symbol Meaning

⌊x⌋ Floor of x, i.e., round down to nearest integer ⌈x⌉ Ceiling of x, i.e., round up to nearest integer x y Convolution of x and y x ⊙ y Hadamard (elementwise) product of x and y a ^ b logical AND a _ b logical OR :a logical NOT I(x) Indicator function, I(x) = 1 if x is true, else I(x) = 0 ¥ Infinity ! Tends towards, e.g., n! ¥ μ Proportional to, so y = ax can be written as y μ x jxj Absolute value jSj Size (cardinality) of a set n! Factorial function Ñ Vector of first derivatives Ñ^2 Hessian matrix of second derivatives ≜ Defined as O() Big-O: roughly means order of magnitude R The real numbers 1 : n Range (Matlab convention): 1 : n = 1 ; 2 ; :::; n  Approximately equal to arg max x f (x) Argmax: the value x that maximizes f

B(a; b) Beta function, B(a; b) =

G (a) G (b) G (a + b)

B( ) Multivariate beta function,

Õ

k

G ( ak)

G (å k

ak) (n k

n choose k , equal to n!=(k!(nk)!) d (x) Dirac delta function, d (x) = ¥ if x = 0, else d (x) = 0 exp(x) Exponential function ex G (x) Gamma function, G (x) =

∫ (^) ¥ 0 u x (^1) eudu

Y (x) Digamma function,Psi(x) =

d dx log G (x)

xiii

xiv Notation

X A set from which values are drawn (e.g.,X = RD)

Linear algebra notation

We use boldface lower-case to denote vectors, such as x, and boldface upper-case to denote matrices, such as X. We denote entries in a matrix by non-bold upper case letters, such as Xi j. Vectors are assumed to be column vectors, unless noted otherwise. We use (x 1 ;    ; xD) to denote a column vector created by stacking D scalars. If we write X = (x 1 ;    ; xn), where the left hand side is a matrix, we mean to stack the xi along the columns, creating a matrix.

Symbol Meaning X ≻ 0 X is a positive definite matrix tr(X) Trace of a matrix det(X) Determinant of matrix X jXj Determinant of matrix X X^1 Inverse of a matrix X†^ Pseudo-inverse of a matrix XT^ Transpose of a matrix xT^ Transpose of a vector diag(x) Diagonal matrix made from vector x diag(X) Diagonal vector extracted from matrix X I or Id Identity matrix of size d  d (ones on diagonal, zeros of) 1 or (^1) d Vector of ones (of length d) 0 or (^0) d Vector of zeros (of length d)

jjxjj = jjxjj 2 Euclidean or ℓ 2 norm

d å j= 1

x^2 j

jjxjj 1 ℓ 1 norm

d å j= 1

x (^) j

X:; j j’th column of matrix Xi;: transpose of i’th row of matrix (a column vector) Xi; j Element (i; j) of matrix X x y Tensor product of x and y

Probability notation

We denote random and fixed scalars by lower case, random and fixed vectors by bold lower case, and random and fixed matrices by bold upper case. Occasionally we use non-bold upper case to denote scalar random variables. Also, we use p() for both discrete and continuous random variables

Symbol Meaning X;Y Random variable P() Probability of a random event F() Cumulative distribution function(CDF), also called distribution function p(x) Probability mass function(PMF) f (x) probability density function(PDF) F(x; y) Joint CDF p(x; y) Joint PMF f (x; y) Joint PDF

xvi Notation

K Number of states or dimensions of a variable (often latent) k(x; y) Kernel function K Kernel matrix H Hypothesis space L Loss function J() Cost function f (x) Decision function P(yjx) TODO l Strength of ℓ 2 or ℓ 1 regularizer ϕ (x) Basis function expansion of feature vector x F Basis function expansion of design matrix X q() Approximate or proposal distribution Q(; old ) Auxiliary function in EM T Length of a sequence T (D) Test statistic for data T Transition matrix of Markov chain  Parameter vector (s)^ s’th sample of parameter vector ˆ Estimate (usually MLE or MAP) of  ^ ˆMLE Maximum likelihood estimate of  ^ ˆMAP MAP estimate of  ^ ¯ Estimate (usually posterior mean) of  w Vector of regression weights (called in statistics) b intercept (called e in statistics) W Matrix of regression weights xi j Component (i.e., feature) j of data case i ,for i = 1 : N; j = 1 : D xi Training case, i = 1 : N X Design matrix of size N  D x ¯ Empirical mean ¯x =

N

åNi= 1 xi x ˜ Future test case x Feature test case y Vector of all training labels y = (y 1 ; :::; yN ) zi j Latent component j for case i

Chapter 1

Introduction

1.1 Types of machine learning

Supervised learning

Classification Regression

Unsupervised learning

Discovering clusters Discovering latent factors Discovering graph structure Matrix completion

1.2 Three elements of a machine learning

model

Model = Representation + Evaluation + Optimization^1

1.2.1 Representation

In supervised learning, a model must be represented as a conditional probability distribution P(yjx)(usually we call it classifier) or a decision function f (x). The set of classifiers(or decision functions) is called the hypothesis space of the model. Choosing a representation for a model is tantamount to choosing the hypothesis space that it can possibly learn.

1.2.2 Evaluation

In the hypothesis space, an evaluation function (also called objective function or risk function) is needed to distinguish good classifiers(or decision functions) from bad ones.

1.2.2.1 Loss function and risk function

Definition 1.1. In order to measure how well a function fits the training data, a loss function L : Y Y! R  0 is

(^1) Domingos, P. A few useful things to know about machine learning. Commun. ACM. 55(10):7887 (2012).

defined. For training example (xi; yi), the loss of predict- ing the value by is L(yi; by).

The following is some common loss functions:

  1. 0-1 loss function L(Y; f (X)) = I(Y; f (X)) =

1 ; Y = f (X) 0 ; Y ̸= f (X)

  1. Quadratic loss function L(Y; f (X)) = (Y f (X))^2
  2. Absolute loss function L(Y; f (X)) = jY f (X)j
  3. Logarithmic loss function L(Y; P(Y jX)) = log P(Y jX)

Definition 1.2. The risk of function f is defined as the ex- pected loss of f :

Rexp( f ) = E [L (Y; f (X))] =

∫ L (y; f (x)) P(x; y)dxdy (1.1) which is also called expected loss or risk function.

Definition 1.3. The risk function Rexp( f ) can be esti- mated from the training data as

Remp( f ) =

N

N å i= 1

L (yi; f (xi)) (1.2)

which is also called empirical loss or empirical risk.

You can define your own loss function, but if you’re a novice, you’re probably better off using one from the literature. There are conditions that loss functions should meet^2 :

  1. They should approximate the actual loss you’re trying to minimize. As was said in the other answer, the stan- dard loss functions for classification is zero-one-loss (misclassification rate) and the ones used for training classifiers are approximations of that loss.
  2. The loss function should work with your intended op- timization algorithm. That’s why zero-one-loss is not used directly: it doesn’t work with gradient-based opti- mization methods since it doesn’t have a well-defined gradient (or even a subgradient, like the hinge loss for SVMs has). The main algorithm that optimizes the zero-one-loss directly is the old perceptron algorithm(chapter §??). (^2) http://t.cn/zTrDxLO

1

Chapter 2

Probability

2.1 Frequentists vs. Bayesians

what is probability? One is called the frequentist interpretation. In this view, probabilities represent long run frequencies of events. For example, the above statement means that, if we flip the coin many times, we expect it to land heads about half the time. The other interpretation is called the Bayesian inter- pretation of probability. In this view, probability is used to quantify our uncertainty about something; hence it is fundamentally related to information rather than repeated trials (Jaynes 2003). In the Bayesian view, the above state- ment means we believe the coin is equally likely to land heads or tails on the next toss One big advantage of the Bayesian interpretation is that it can be used to model our uncertainty about events that do not have long term frequencies. For example, we might want to compute the probability that the polar ice cap will melt by 2020 CE. This event will happen zero or one times, but cannot happen repeatedly. Nevertheless, we ought to be able to quantify our uncertainty about this event. To give another machine learning oriented exam- ple, we might have observed a blip on our radar screen, and want to compute the probability distribution over the location of the corresponding target (be it a bird, plane, or missile). In all these cases, the idea of repeated trials does not make sense, but the Bayesian interpretation is valid and indeed quite natural. We shall therefore adopt the Bayesian interpretation in this book. Fortunately, the basic rules of probability theory are the same, no matter which interpretation is adopted.

2.2 A brief review of probability theory

2.2.1 Basic concepts

We denote a random event by defining a random variable X. Descrete random variable: X can take on any value from a finite or countably infinite set. Continuous random variable: the value of X is real- valued.

2.2.1.1 CDF

F(x) ≜ P(X  x) =

åux p(u)^ , discrete ∫ (^) x ¥ f^ (u)du^ , continuous^

2.2.1.2 PMF and PDF

For descrete random variable, We denote the probability of the event that X = x by P(X = x), or just p(x) for short. Here p(x) is called a probability mass function or PMF.A probability mass function is a function that gives the probability that a discrete random variable is ex- actly equal to some value^4. This satisfies the properties 0  p(x)  1 and (^) åx 2 X p(x) = 1. For continuous variable, in the equation F(x) =

∫ (^) x ¥ f^ (u)du,^ the^ function^ f^ (x)^ is^ called^ a probability density function or PDF. A probability density function is a function that describes the rela- tive likelihood for this random variable to take on a given value∫ 5 .This satisfies the properties f (x)  0 and ¥ ¥ f^ (x)dx^ =^ 1.

2.2.2 Mutivariate random variables

2.2.2.1 Joint CDF

We denote joint CDF by F(x; y) ≜ P(X  x \ Y  y) = P(X  x;Y  y).

F(x; y) ≜ P(X  x;Y  y) =

åux;vy p(u;^ v) ∫ (^) x ¥

∫ (^) y ¥ f^ (u;^ v)dudv (2.2) product rule:

p(X;Y ) = P(XjY )P(Y ) (2.3)

Chain rule:

(^4) http://en.wikipedia.org/wiki/Probability_ mass_function (^5) http://en.wikipedia.org/wiki/Probability_ density_function

3

4

p(X1:N ) = p(X 1 )p(X 3 jX 2 ; X 1 ):::p(XN jX1:N 1 ) (2.4)

2.2.2.2 Marginal distribution

Marginal CDF:

FX (x) ≜ F(x; +¥) = 8 < :

å xix

P(X = xi) = å xix

+¥ å j= 1

P(X = xi;Y = y (^) j) ∫ (^) x ¥ fX^ (u)du^ =^

∫ (^) x ¥

∫ (^) +¥ ¥ f^ (u;^ v)dudv

FY (y) ≜ F(+¥; y) = 8

<

:

å y (^) j y

p(Y = y (^) j) =

+¥ å i= 1

åy (^) j y P(X^ =^ xi;Y^ =^ y^ j) ∫ (^) y ¥ fY^ (v)dv^ =^

∫ (^) +¥ ¥

∫ (^) y ¥ f^ (u;^ v)dudv

Marginal PMF and PDF: { P(X = xi) = å+ j=¥ 1 P(X = xi;Y = y (^) j) , descrete fX (x) =

∫ (^) +¥ ¥ f^ (x;^ y)dy^ , continuous (2.7)

{ p(Y = y (^) j) = (^) å+ i=¥ 1 P(X = xi;Y = y (^) j) , descrete fY (y) =

∫ (^) +¥ ¥ f^ (x;^ y)dx^ , continuous (2.8)

2.2.2.3 Conditional distribution

Conditional PMF:

p(X = xijY = y (^) j) =

p(X = xi;Y = y (^) j) p(Y = y (^) j)

if p(Y ) > 0 (2.9)

The pmf p(XjY ) is called conditional probability. Conditional PDF:

fXjY (xjy) = f (x; y) fY (y)

2.2.3 Bayes rule

p(Y = yjX = x) = p(X = x;Y = y) p(X = x)

=

p(X = xjY = y)p(Y = y) åy′ p(X = xjY = y′)p(Y = y′) (2.11)

2.2.4 Independence and conditional

independence

We say X and Y are unconditionally independent or marginally independent, denoted X? Y , if we can represent the joint as the product of the two marginals, i.e., X? Y = P(X;Y ) = P(X)P(Y ) (2.12) We say X and Y are conditionally independent(CI) given Z if the conditional joint can be written as a product of conditional marginals:

X? Y jZ = P(X;Y jZ) = P(XjZ)P(Y jZ) (2.13)

2.2.5 Quantiles

Since the cdf F is a monotonically increasing function, it has an inverse; let us denote this by F^1. If F is the cdf of X , then F^1 ( a) is the value of x a such that P(X  x a ) = a; this is called the a quantile of F. The value F^1 ( 0 : 5 ) is the median of the distribution, with half of the probability mass on the left, and half on the right. The values F^1 ( 0 : 25 ) and F^1 ( 0 : 75 )are the lower and up- per quartiles.

2.2.6 Mean and variance

The most familiar property of a distribution is its mean,or expected value, denoted by m. For discrete rvs, it is de- fined as E[X] ≜ åx 2 X xp(x), and for continuous rvs, it is defined as E[X] ≜

∫ X xp(x)dx. If this integral is not finite, the mean is not defined (we will see some examples of this later). The variance is a measure of the spread of a distribu- tion, denoted by s 2. This is defined as follows:

var[X] = E[(X m)^2 ] (2.14)

=

∫ (x m)^2 p(x)dx

=

∫ x^2 p(x)dx + m^2

∫ p(x)dx 2 m

∫ xp(x)dx

= E[X^2 ] m^2 (2.15)

from which we derive the useful result

E[X^2 ] = s 2 + m^2 (2.16)

The standard deviation is defined as