Вы находитесь на странице: 1из 27

Lecture 10

Reasoning: Random Variables


A.Vinciarelli
Artificial Intelligence 4 (AI4)
School of Computing Science
University of Glasgow (UK)

Lecture 10: Reference


This lecture corresponds to Appendix A of the
following textbook:
Machine Learning for Audio, Image and Video
Analysis
F.Camastra and A.Vinciarelli
www.dcs.gla.ac.uk/vincia/textbook.pdf

Artificial Intelligence
School of Computing Science
Slide 2 of 27

The Intelligent Agent


Sensors

Actuators

Percepts

Actions

Environment

Agent

Program and reasoning

Artificial Intelligence
School of Computing Science
Slide 3 of 27

Outline

Random Variables

Mean, Variance, Covariance

Artificial Intelligence
School of Computing Science
Slide 4 of 27

Outline

Random Variables

Mean, Variance, Covariance

Artificial Intelligence
School of Computing Science
Slide 5 of 27

Random Variables
= ()
I

A variable is said to be a random variable


when its values depend on the events of a
sample space
A variable that takes the value of the
number printed on the face of a dice is a
random variable
Artificial Intelligence
School of Computing Science
Slide 6 of 27

Probability Distribution
I

Random variables are associated to


functions called Probability Distributions that
provide the probability of falling between xi
and xj (with xi xj )
Probability distributions are different
depending on whether the random variable
is discrete or continuous

Artificial Intelligence
School of Computing Science
Slide 7 of 27

Discrete Random Variables

P(xi xj ) =

xj
X

p ()

=xi
I

The values of a discrete variable belong to a


finite set X = {x1 , x2 , . . . , xN }
It is possible to know the probability that
takes a specific value xk : P( = xk ) = p (xk )
p () is the probability distribution
Artificial Intelligence
School of Computing Science
Slide 8 of 27

Cumulative Distribution (I)


Hay un error. La xi dentro de los parentesis deberia ser Xi. Es el ndice
del sumatorio. La xi que va justo despus de la p es para indicar que
variable aleatoria.
x
X

F (x) = P( x) =

p ()

=
I

The cumulative distribution F (x) provides


the probability that x
When
/ X , p() = 0

F(3.7) = P(xi <= 3.7) = p xi (1) + p xi (2) + p xi (3)

Artificial Intelligence
School of Computing Science
Slide 9 of 27

Cumulative Distribution (II)

F () =

X
=

p () =

N
X

p (xk ) = 1

k =1

The probability of being less than is the


probability that takes any of the values in X
When
/ X , p() = 0

Artificial Intelligence
School of Computing Science
Slide 10 of 27

Continuous Random Variables


Z

x2

P(x1 x2 ) =

p (x)dx
x1

The values of a continuous variable belong


to a continuous interval [a, b]
It is possible to know the probability p (x)dx
that falls between x and x + dx
p (x) is the probability density function
x + dx is a value infintitely close to x.
Artificial Intelligence
School of Computing Science
Slide 11 of 27

Cumulative Distribution (I)

F (x) = P( x) =

p (x 0 )dx 0

The cumulative distribution F (x) provides


the probability that x
When < a or > b, p() = 0
x prime is the integration variable

Artificial Intelligence
School of Computing Science
Slide 12 of 27

Cumulative Distribution (II)

F () =

p (x)dx =

p (x)dx = 1
a

The probability of being less than is the


probability that takes any of the values in
[a, b]
When < a or > b, p() = 0

Artificial Intelligence
School of Computing Science
Slide 13 of 27

Discrete Joint Probability Distribution (I)

P(1 = x, 2 = y ) = p1 2 (x, y )
I

The joint probability distribution p1 2 (x, y )


provides the probability that = x and = y
1 X {x1 , . . . , xN } and 2 Y = {y1 , . . . , yM }
are discrete random variables

Artificial Intelligence
School of Computing Science
Slide 14 of 27

Discrete Joint Probability Distribution (II)


xi1 y xi2 dentro del parentesis son los indices del sumatorio
x: de i a j
y: de k a l
xj ,yl

P(xi 1 xj , yk 2 yl ) =

p1 2 (1 , 2 )

1 =xi ,2 =yk

The joint probability distribution allows one to


estimate the probability that xi 1 xj and
yk 2 yl , with xi xj and yk yl

Artificial Intelligence
School of Computing Science
Slide 15 of 27

Discrete Joint Cumulative Distribution

F (x, y ) = P(1 x, 2 y ) =

x,y
X

p1 2 (1 , 2 )

1 =,2 =

The joint cumulative distribution allows one


to estimate the probability that 1 x and
2 y , with F (, ) = 1

Artificial Intelligence
School of Computing Science
Slide 16 of 27

Joint Probability Density Function

P(x 1 x+dx, y 2 y +dy ) = p1 ,2 (x, y )dxdy

The values of 1 and 2 belong to continuous


intervals: 1 [a, b] and 2 [c, d]
The joint Probability Density Function
p (1 , 2 ) allows one to estimate
P(x 1 x + dx, y 2 y + dy )
Artificial Intelligence
School of Computing Science
Slide 17 of 27

Cumulative Distribution (I)


F (x, y ) = P(1 x, 2 y )
Z x Z y
p (x 0 , y 0 )dx 0 dy 0

The cumulative distribution F (x, y ) provides


the probability that 1 x and 2 y
When 1
/ [a, b] or 2
/ [c, d], p(1 , 2 ) = 0

Artificial Intelligence
School of Computing Science
Slide 18 of 27

Cumulative Distribution (II)


Z

p (x 0 , y 0 )dx 0 dy 0 = 1

F (, ) =

The cumulative distribution F (, )


provides the probability that 1 and 2 take
any of the values in [a.b] and [c, d],
respectively.
When 1
/ [a, b] or 2
/ [c, d], p(1 , 2 ) = 0
Artificial Intelligence
School of Computing Science
Slide 19 of 27

Outline

Random Variables

Mean, Variance, Covariance

Artificial Intelligence
School of Computing Science
Slide 20 of 27

Mean Value (Discrete)

E() =

X
x=

xp (x) =

N
X

xk p (xk )

k =1

E() is the Mathematical Expectation or


Mean Value of p ()
The mean E() is not necessarily in
X = {x1 , . . . , xN }

Artificial Intelligence
School of Computing Science
Slide 21 of 27

Mean Value (Continuous)

E() =

xp (x)dx =

xp (x)dx
a

E() is the Mathematical Expectation or


Mean Value of p ()

Artificial Intelligence
School of Computing Science
Slide 22 of 27

Variance (Discrete)

[x E()] p (x) =

x=

I
I

N
X

[xk E()]2 p (xk )

k =1

2 is the variance or dispersion of p ()


The variance is the mean of [ E()]2 , the
square of the difference between the
variable and the mean

Artificial Intelligence
School of Computing Science
Slide 23 of 27

Variance (Continuous)
2

[x E()]2 p (x)dx =

[x E()]2 p (x)dx

a
I
I

2 is the variance or dispersion of p ()


The variance is the mean of [ E()]2 , the
square of the difference between the
variable and the mean
Artificial Intelligence
School of Computing Science
Slide 24 of 27

Covariance

1 2 = E{[1 E(1 )][2 E(2 )]}


I

The covariance is a measurement of how


much two variables covariate, i.e., tend to
jointly increase or jointly decrease

Artificial Intelligence
School of Computing Science
Slide 25 of 27

Covariance (Discrete)

1 2 =

[10 E(10 )][20 E(20 )]p1 2 (10 , 20 )

10 = 20 =

The covariance is a measurement of how


much two variables covariate, i.e., tend to
jointly increase or jointly decrease

Artificial Intelligence
School of Computing Science
Slide 26 of 27

Covariance (Continuous)

1 2 =
Z

[10 E(10 )][20 E(20 )]p1 2 (10 , 20 )d10 d20

The covariance is a measurement of how


much two variables covariate, i.e., tend to
jointly increase or jointly decrease

Artificial Intelligence
School of Computing Science
Slide 27 of 27

Вам также может понравиться