EM CODE IN MATLAB with examples

5 次查看(过去 30 天)
biao Peng
biao Peng 2020-11-7
I would like to know how EM matab code dealing with attached data to solve missing label problem.
see problem 1 as follows:
  • Save “hw3.mat” in your Matlab working directory.
  • In Matlab, type “load hw3.mat”
  • Then type “who”, you will find three matrices named “hw3_1”, “hw3_2_1” and “hw3_2_2”.
  • Each of these matrices has a size of 2×100, i.e. 2 rows and 100 columns. Each column is a 2-D observation vector.
Problem 1: The sample vectors in “hw3_1” are drawn from a Gaussian Mixture Model (GMM) with two mixtures, which can be expressed as
where x, µ1, µ2 are 2×1 vectors, and Σ1, Σ2 are 2×2 matrices, and ρ is the mixing parameter.
Use Expectation-Maximization (EM) algorithm to estimate the parameters µ1, µ2, Σ1, Σ2 and ρ.
Hint: Let the initial ρ0=0.5, and assume the first 50 samples are from p1(x) and the next 50 samples are from p2(x). Use Maximum Likelihood method (CPE646-4, page 19) to estimate the initial µ1, µ2, Σ1, Σ2
Problem 2: The sample vectors in “hw3_2_1” are from class ω1 and sample vectors in “hw3_2_2” are from class ω2
  1. Use Parzen window method to estimate the class conditional density functions p(x|ω1) and p(x|ω2) for every x in {-4:0.1:8, -4:0.1:8}; use “mesh” function in Matlab to plot the results; and then classify x=[1,-2]t based on the estimation. Let h1=2.
  1. Construct a Probabilistic Neural Network (PNN); and classify x=[1,-2]t. Let σ=0.2.

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Statistics and Machine Learning Toolbox 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by