I'm considering an EM algorithm of correlated random effects model
$y_{it} = \beta x_{it} + \mu_i + \varepsilon_{it},(i=1,...,n;t=1,...,T)$
where $y_{it}$ and $x_{it}$ are observed, but $\mu_i$ and $\varepsilon_{it}$ are not observed. Assume that all the variables are random(not deterministic).
In a vector form,
$y_{i} = \beta x_{i} + \iota_T \mu_i + \varepsilon_{i},(i=1,...,n)$
where $y_i=(y_{i1},...,y_{iT})'$, $\iota_T=(1,...,1)'$ etc. Assume that $x_i$ is correlated with $\mu_i$ but uncorrelated with $\varepsilon_i$.
To derive the complete-data log likelihood function, assume that $\mu_i$ is observable. Then, the joint density can be written as
$f(y_{i},x_{i},\mu_{i} )=f(y_i,x_i|\mu_i) f(\mu_i)$
However, I'm wondering if this is further written as
$f(y_{i},x_{i},\mu_{i} )=f(y_i|x_i, \mu_i) f(x_i|\mu_i) f(\mu_i)=f(\varepsilon_i|x_i, \mu_i) f(x_i|\mu_i) f(\mu_i)$
and the comlete-data log likelihood for $i$th observation can be written as
$\log f(y_{i},x_{i},\mu_{i} ) = \log f(\varepsilon_i|x_i, \mu_i) + \log f(x_i|\mu_i) +\log f(\mu_i)$
Is this formula correct?