This is note I wrote as I was take following lecture
http://www.kocw.net/home/search/kemView.do?kemId=1189957
================================================================================
* Code
# Random variables X1, X2
# c N: number of sample
N=100
# ================================================================================
# c mu_1: expectation value of random variable X1
mu_1=[380,300]
# c sigma_1: covariance matrix
sigma_1=[[300,30],[30,200]]
# Generate random data (100,2) which follows above parameters
X1=generate_data_using_parameters(mu_1,sigma_1,N)
# ================================================================================
# c mu_2: expectation value of random variable X1
mu_2=[430,350]
# c sigma_2: covariance matrix
sigma_2=[[400,100],[100,90]]
# Generate random data (100,2) which follows above parameters
X2=generate_data_using_parameters(mu_2,sigma_2,N)
# ================================================================================
================================================================================
plot(X1,X2)
================================================================================
plot_gaus(X1,X2)
Abvoe shows "TRUE" mean and covariance
================================================================================
* Let's inference mean and variance of population by using Maximum Likelihood (ML) inference
inferenced1=ML(X1)
inferenced2=ML(X2)
plot(inferenced1,inferenced2)
* Meaning: parameters ($$$\mu$$$ and $$$\sigma$$$) correctly inferenced
================================================================================
data=generate_one_sample_data_point()
plot(data)
* Posterior probability of "new data" occuring from class1 (red) = 0.0020
* Posterior probability of "new data" occuring from class1 (green) = 0.4476
* Selected class for that new data: green class
================================================================================
* Summary you should remember
* You are given population data
* You sample data from population
* You inference parameters from sampled data by using ML, MLE
* You inference "probability density function of population" from inferenced parameters
* You use posterior probability by using for example LRT, Bayes risk, etc
to classify given new data into best proper class
================================================================================