ellipse and gaussian distribution - i-systems.github.ioi-systems.github.io/hse545/machine learning...

36
Ellipse and Gaussian Distribution Industrial AI Lab.

Upload: others

Post on 25-Oct-2019

19 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Ellipse and Gaussian Distribution - i-systems.github.ioi-systems.github.io/HSE545/machine learning all/10 Gaussian/22 Gaussian... · Equation of an Ellipse •Dependent ellipse (Rotated

Ellipse and Gaussian Distribution

Industrial AI Lab.

Page 2: Ellipse and Gaussian Distribution - i-systems.github.ioi-systems.github.io/HSE545/machine learning all/10 Gaussian/22 Gaussian... · Equation of an Ellipse •Dependent ellipse (Rotated

Coordinates with Basis

• Basis Ƹ𝑒1 Ƹ𝑒2 or basis ො𝑞1 ො𝑞2

2

Page 3: Ellipse and Gaussian Distribution - i-systems.github.ioi-systems.github.io/HSE545/machine learning all/10 Gaussian/22 Gaussian... · Equation of an Ellipse •Dependent ellipse (Rotated

Coordinate Transformation

3

Page 4: Ellipse and Gaussian Distribution - i-systems.github.ioi-systems.github.io/HSE545/machine learning all/10 Gaussian/22 Gaussian... · Equation of an Ellipse •Dependent ellipse (Rotated

Coordinate Transformation

• Coordinate change to basis of ො𝑞1 ො𝑞2

4

Page 5: Ellipse and Gaussian Distribution - i-systems.github.ioi-systems.github.io/HSE545/machine learning all/10 Gaussian/22 Gaussian... · Equation of an Ellipse •Dependent ellipse (Rotated

Equation of an Ellipse

• Unit circle

5

ො𝑥1

ො𝑥2

1

1

Page 6: Ellipse and Gaussian Distribution - i-systems.github.ioi-systems.github.io/HSE545/machine learning all/10 Gaussian/22 Gaussian... · Equation of an Ellipse •Dependent ellipse (Rotated

Equation of an Ellipse

• Independent ellipse

6

ො𝑥1

ො𝑥2

𝑏

𝑎

Page 7: Ellipse and Gaussian Distribution - i-systems.github.ioi-systems.github.io/HSE545/machine learning all/10 Gaussian/22 Gaussian... · Equation of an Ellipse •Dependent ellipse (Rotated

Equation of an Ellipse

• Dependent ellipse (Rotated ellipse)– Coordinate changes

• Now we know in basis ො𝑥1, ො𝑥2 = 𝐼

7

ො𝑥1

ො𝑥2

ො𝑦2

ො𝑦1

𝑏

𝑎ො𝑦1

ො𝑦2

𝑏𝑎

𝑥 = 𝑢𝑇𝑦

𝑢 = [ො𝑥1, ො𝑥2]

dependent ellipse

Page 8: Ellipse and Gaussian Distribution - i-systems.github.ioi-systems.github.io/HSE545/machine learning all/10 Gaussian/22 Gaussian... · Equation of an Ellipse •Dependent ellipse (Rotated

Equation of an Ellipse

• Then, we can find Σ𝑦 such that

8

Page 9: Ellipse and Gaussian Distribution - i-systems.github.ioi-systems.github.io/HSE545/machine learning all/10 Gaussian/22 Gaussian... · Equation of an Ellipse •Dependent ellipse (Rotated

Equation of an Ellipse (Python)

9

Page 10: Ellipse and Gaussian Distribution - i-systems.github.ioi-systems.github.io/HSE545/machine learning all/10 Gaussian/22 Gaussian... · Equation of an Ellipse •Dependent ellipse (Rotated

Equation of an Ellipse (Python)

10

Page 11: Ellipse and Gaussian Distribution - i-systems.github.ioi-systems.github.io/HSE545/machine learning all/10 Gaussian/22 Gaussian... · Equation of an Ellipse •Dependent ellipse (Rotated

Equation of an Ellipse (Python)

11

Page 12: Ellipse and Gaussian Distribution - i-systems.github.ioi-systems.github.io/HSE545/machine learning all/10 Gaussian/22 Gaussian... · Equation of an Ellipse •Dependent ellipse (Rotated

Equation of an Ellipse (Python)

12

Page 13: Ellipse and Gaussian Distribution - i-systems.github.ioi-systems.github.io/HSE545/machine learning all/10 Gaussian/22 Gaussian... · Equation of an Ellipse •Dependent ellipse (Rotated

Question (Reverse Problem)

• Given Σ𝑦−1 (or Σ𝑦), how to find 𝑎 (major axis) and 𝑏 (minor axis)

or

• How to find the proper matrix 𝑢

• Eigenvectors of Σ

13

Page 14: Ellipse and Gaussian Distribution - i-systems.github.ioi-systems.github.io/HSE545/machine learning all/10 Gaussian/22 Gaussian... · Equation of an Ellipse •Dependent ellipse (Rotated

Question (Reverse Problem)

14

ො𝑦1

ො𝑦2ො𝑥1

ො𝑥2𝑎 = 𝜆1

𝑏 = 𝜆2

Page 15: Ellipse and Gaussian Distribution - i-systems.github.ioi-systems.github.io/HSE545/machine learning all/10 Gaussian/22 Gaussian... · Equation of an Ellipse •Dependent ellipse (Rotated

Question (Reverse Problem)

15

Page 16: Ellipse and Gaussian Distribution - i-systems.github.ioi-systems.github.io/HSE545/machine learning all/10 Gaussian/22 Gaussian... · Equation of an Ellipse •Dependent ellipse (Rotated

Summary

• Independent ellipse in ො𝑥1, ො𝑥2• Dependent ellipse in ො𝑦1, ො𝑦2• Decouple– diagonalize

– eigen-analysis

16

ො𝑥1

ො𝑥2

ො𝑦2

ො𝑦1

𝑏

𝑎ො𝑦1

ො𝑦2

𝑏𝑎

𝑥 = 𝑢𝑇𝑦

𝑢 = [ො𝑥1, ො𝑥2]

dependent ellipse

Page 17: Ellipse and Gaussian Distribution - i-systems.github.ioi-systems.github.io/HSE545/machine learning all/10 Gaussian/22 Gaussian... · Equation of an Ellipse •Dependent ellipse (Rotated

Standard Univariate Normal Distribution

17

0 𝑦

𝑃(𝑦)

Page 18: Ellipse and Gaussian Distribution - i-systems.github.ioi-systems.github.io/HSE545/machine learning all/10 Gaussian/22 Gaussian... · Equation of an Ellipse •Dependent ellipse (Rotated

Standard Univariate Normal Distribution

18

Page 19: Ellipse and Gaussian Distribution - i-systems.github.ioi-systems.github.io/HSE545/machine learning all/10 Gaussian/22 Gaussian... · Equation of an Ellipse •Dependent ellipse (Rotated

Standard Univariate Normal Distribution

19

Page 20: Ellipse and Gaussian Distribution - i-systems.github.ioi-systems.github.io/HSE545/machine learning all/10 Gaussian/22 Gaussian... · Equation of an Ellipse •Dependent ellipse (Rotated

Standard Univariate Normal Distribution

20

Page 21: Ellipse and Gaussian Distribution - i-systems.github.ioi-systems.github.io/HSE545/machine learning all/10 Gaussian/22 Gaussian... · Equation of an Ellipse •Dependent ellipse (Rotated

Univariate Normal distribution

• Gaussian or normal distribution, 1D (mean 𝜇, variance 𝜎2)

21

0 𝑥

𝑃(𝑥)

Page 22: Ellipse and Gaussian Distribution - i-systems.github.ioi-systems.github.io/HSE545/machine learning all/10 Gaussian/22 Gaussian... · Equation of an Ellipse •Dependent ellipse (Rotated

Univariate Normal distribution

22

Page 23: Ellipse and Gaussian Distribution - i-systems.github.ioi-systems.github.io/HSE545/machine learning all/10 Gaussian/22 Gaussian... · Equation of an Ellipse •Dependent ellipse (Rotated

Univariate Normal distribution

23

Page 24: Ellipse and Gaussian Distribution - i-systems.github.ioi-systems.github.io/HSE545/machine learning all/10 Gaussian/22 Gaussian... · Equation of an Ellipse •Dependent ellipse (Rotated

Univariate Normal distribution

24

Page 25: Ellipse and Gaussian Distribution - i-systems.github.ioi-systems.github.io/HSE545/machine learning all/10 Gaussian/22 Gaussian... · Equation of an Ellipse •Dependent ellipse (Rotated

Multivariate Gaussian Models

• Similar to a univariate case, but in a matrix form

• Multivariate Gaussian models and ellipse– Ellipse shows constant Δ2 value…

25

Page 26: Ellipse and Gaussian Distribution - i-systems.github.ioi-systems.github.io/HSE545/machine learning all/10 Gaussian/22 Gaussian... · Equation of an Ellipse •Dependent ellipse (Rotated

Two Independent Variables

• In a matrix form

26

Page 27: Ellipse and Gaussian Distribution - i-systems.github.ioi-systems.github.io/HSE545/machine learning all/10 Gaussian/22 Gaussian... · Equation of an Ellipse •Dependent ellipse (Rotated

Two Independent Variables

• Summary in a matrix form

27

ො𝑥1

ො𝑥2

Page 28: Ellipse and Gaussian Distribution - i-systems.github.ioi-systems.github.io/HSE545/machine learning all/10 Gaussian/22 Gaussian... · Equation of an Ellipse •Dependent ellipse (Rotated

Two Independent Variables

28

Page 29: Ellipse and Gaussian Distribution - i-systems.github.ioi-systems.github.io/HSE545/machine learning all/10 Gaussian/22 Gaussian... · Equation of an Ellipse •Dependent ellipse (Rotated

Two Independent Variables

29

Page 30: Ellipse and Gaussian Distribution - i-systems.github.ioi-systems.github.io/HSE545/machine learning all/10 Gaussian/22 Gaussian... · Equation of an Ellipse •Dependent ellipse (Rotated

Two Dependent Variables in 𝒚𝟏, 𝒚𝟐

• Compute 𝑃𝑌 𝑦 from 𝑃𝑋 𝑥

• Relationship between 𝑦 and 𝑥

30

ො𝑥1

ො𝑥2

ො𝑦2 ො𝑦1

ො𝑦2

ො𝑦1

Page 31: Ellipse and Gaussian Distribution - i-systems.github.ioi-systems.github.io/HSE545/machine learning all/10 Gaussian/22 Gaussian... · Equation of an Ellipse •Dependent ellipse (Rotated

Two Dependent Variables in 𝒚𝟏, 𝒚𝟐

• Σ𝑥 : covariance matrix of 𝑥

• Σ𝑦 : covariance matrix of 𝑦

• If 𝑢 is an eigenvector matrix of Σ𝑦, then Σ𝑥 is a diagonal matrix

31

Page 32: Ellipse and Gaussian Distribution - i-systems.github.ioi-systems.github.io/HSE545/machine learning all/10 Gaussian/22 Gaussian... · Equation of an Ellipse •Dependent ellipse (Rotated

Two Dependent Variables in 𝒚𝟏, 𝒚𝟐

32

Page 33: Ellipse and Gaussian Distribution - i-systems.github.ioi-systems.github.io/HSE545/machine learning all/10 Gaussian/22 Gaussian... · Equation of an Ellipse •Dependent ellipse (Rotated

Two Dependent Variables in 𝒚𝟏, 𝒚𝟐

• Remark

33

Page 34: Ellipse and Gaussian Distribution - i-systems.github.ioi-systems.github.io/HSE545/machine learning all/10 Gaussian/22 Gaussian... · Equation of an Ellipse •Dependent ellipse (Rotated

Decouple using Covariance Matrix

• Given data, how to find Σ𝑦 and major (or minor) axis

(assume 𝜇𝑦 = 0)

34

ො𝑦2

ො𝑦1

ො𝑥2

ො𝑥1

𝜆2

𝜆1

Page 35: Ellipse and Gaussian Distribution - i-systems.github.ioi-systems.github.io/HSE545/machine learning all/10 Gaussian/22 Gaussian... · Equation of an Ellipse •Dependent ellipse (Rotated

Decouple using Covariance Matrix

35

Page 36: Ellipse and Gaussian Distribution - i-systems.github.ioi-systems.github.io/HSE545/machine learning all/10 Gaussian/22 Gaussian... · Equation of an Ellipse •Dependent ellipse (Rotated

Decouple using Covariance Matrix

36