clear; clc; close all;
u1 = [4, 2]';
sigma1 = [9, 1]';
u2 = [2, 5]';
sigma2 = [2, 3]';
data1 = Gaussian2D(u1, sigma1, 500);
data2 = Gaussian2D(u2, sigma2, 500);
[w_pca_l, w_pca_m] = calPCA([data1; data2]);
w_fisher = calFisher(data1, data2);
w_mean = (mean(data1 - data2))' / norm((mean(data1 - data2))');
    
poe_fisher = calClassificationError(w_fisher, data1, data2, u1, sigma1, u2, sigma2)
poe_pca_l = calClassificationError(w_pca_l, data1, data2, u1, sigma1, u2, sigma2)
poe_pca_m = calClassificationError(w_pca_m, data1, data2, u1, sigma1, u2, sigma2)
poe_mean = calClassificationError(w_mean, data1, data2, u1, sigma1, u2, sigma2)