# How to define a likelihood function for an EM algorithm [closed]

Assuming $A$ a set of vectors from a normal distribution, and $X$ a projection matrix and $B$ a set of projected vectors of $A$ using $X$:

$B=A*X$

Using an EM approach and by initializing X from random, I am interested in learning $X$ from training data. For the E step, I guess I should initialize $X$ from random, then using the current estimation of $X$, I should update $X$ using my likelihood function. how can I define my likelihood function? and then how can I update $X$ in each iteration?

here is a psudo code for the training data an a simple projection:

A=randn(13, 1000);
X=2*eye(13);
B=X*A;
X_hat=randn(13, 13);

for iter=1:1000
Ex = E_step(X_hat,A,B);
X_hat = M_step(Ex ,X_hat,A,B);
%how to learn X initialized from random?
end

• I suggest you write down the observed and completed likelihoods in your question to make it clearer. Jan 21, 2016 at 9:53
• @Xi'an I have a bit of problem with defining the likelihood function myself. Not sure, but I know I want to minimize $B - A*X_hat$ as much as possible by optimizing $X_hat$ initiated from random. May I ask for your help, please? Jan 21, 2016 at 11:05
• What is your observable? your latent variable? Jan 21, 2016 at 11:28
• $A_i$ are the observations over time, and $X$ is the variable I want to learn. $B_i$ are the projected observations from $A_i$ via $X$. Jan 21, 2016 at 12:21