# Derivation of likelihood function for latent variable model made explicit

I am trying to make the steps deriving the likelihood function for the following latent variable model as explicit as possible: $$Y^0=X\beta + u$$ where $$u \sim NID(0,\sigma^2).$$ The observed data consists of $X$ and $Y$. However, $Y$ is unobserved whenever $Y^0 > c$ and $Y=Y^0$ whenever $Y^0 \leq c$ and not observed otherwise.

My attempt so far is below where $x$ and $y$ are outcomes for $X$ and $Y$, respectively.

I feel very uncertain about steps 3 and 5, which are rather similar, but pretty confident about steps 1, 2, 4, 6, and 7. Part of the problem might be that I lack sufficiently specific notation. Also, I'm not really sure at what point I should start to condition on $y$.

1. By the definition of the likelihood function for continuous variables, $$\mathcal{L}(\beta \mid x,y) = f_{XY}(x,y \mid \beta).$$
2. Since the sample is independent, we have $$\prod_{i=1} f_{XY}(x_i,y_i \mid \beta).$$
3. Imposing structure on $y_i$, we condition on $y_i^0\leq c$ to get something like $$\prod_{i=1} f_{Xu}(x_i,y_i=y_i^0 \mid y_i^0 \leq c, \beta).$$
4. By the definition of the conditional probability density function, we have $$\prod_{i=1} \frac{f_{Xu}(x_i, y_i=y_i^0 \mid \beta)}{F_{Xu}(x_i, y_i^0 \leq c \mid \beta)}.$$
5. Substituting the model for $y_i^0$, we condition on $x_i$ and $y_i$ to get something like $$\prod_{i=1} \frac{f_u(y_i=x_i\beta+u_i \mid x_i, y_i, \beta)}{F_{Xu}(x_i\beta+u_i \leq c \mid x_i, y_i, \beta)}.$$
6. Rearranging, we get $$\prod_{i=1} \frac{f_u(u_i=y_i-x_i\beta \mid x_i, \beta)}{F_{u}(u_i \leq c-x_i\beta \mid x_i, \beta)}.$$
7. By the distribution of $u_i$, we have $$\prod_{i=1} \frac{\varphi(\frac{y_i-x_i\beta}{\sigma})}{\Phi(\frac{c-x_i\beta}{\sigma})}.$$