雙變量高斯混合模型

R 中的混合模型

Victor Medina

Researcher at The University of Edinburgh

Gender 資料

單一變數

gender %>% 
    select(Weight) %>% 
    head()
    Weight
1 241.8936
2 162.3105
3 212.7409
4 220.0425
5 206.3498
6 152.2122

兩個變數

gender %>% 
    select(Weight, BMI) %>% 
    head()
    Weight        BMI
1 241.8936 31.18576
2 162.3105 24.12104
3 212.7409 27.23291
4 220.0425 30.06706
5 206.3498 29.70803
6 152.2122 23.66049
R 中的混合模型

單一變數

兩個變數

R 中的混合模型

以混合模型建模

  1. 哪個機率分佈最合適?
    • 雙變量高斯分佈
  2. 應考慮多少子族群?
    • 2 群
  3. 參數與其估計為何?
    • 平均數(現為 2 維)、「標準差」(現為矩陣)與比例
    • 使用 flexmix 估計
R 中的混合模型

雙變量高斯分佈

mean
10  5
covariance_matrix
     [,1] [,2]
[1,]   25    0
[2,]    0   25
R 中的混合模型

雙變量高斯分佈

mean
10  5
covariance_matrix
     [,1] [,2]
[1,]   25   20
[2,]   20   25

R 中的混合模型

回到 Gender 資料

  1. 哪個分佈?
    • 雙變量高斯分佈
  2. 有幾群?
    • 2
  3. 哪些參數?
    • 比例
    • 平均數
    • 共變異數矩陣
R 中的混合模型

一起來練習吧!

R 中的混合模型

Preparing Video For Download...