$X_1,\ldots, X_{100} \stackrel{iid}{\sim} N(\mu,1)$ iid. Only $X_i <0$ is recorded. 40 observations are less than 0. What is the MLE of $\mu$? $X_1,\ldots, X_{100} \stackrel{iid}{\sim} N(\mu,1)$ but only $X_i <0$ is recorded. 40 observations are less than 0. What is the MLE of $\mu$?
Attempt
Let $X_i = \mu + Z_i$, $Z_i\sim N(0,1)$ let $N$ be the number of $X_i<0$
$P(X<0) = P(\mu+ Z < 0) = P(Z<-\mu) = \Phi(-\mu)$
$P(N=40) = \binom{100}{40}(1-\Phi(-\mu))^{60}(\Phi(-\mu))^{40}$
$\ldots \implies$ the MLE of $\mu$ is $\hat \mu= -\Phi^{-1}(2/5) \approx 0.2533$
is this approach correct?
 A: $X_1,\ldots, X_{100} \stackrel{iid}{\sim} N(\mu,1)$
Lets we know just 40 observations are less than $0$ and others are more that $0$.
so the observation is $(1_{\{X_1<0\}},1_{\{X_2<0\}},\cdots , 1_{\{X_{100}<0\}})$. the likelihood function is
$$f(1_{\{X_1<0\}},1_{\{X_2<0\}},\cdots , 1_{\{X_{100}<0\}})
=(P(X\leq 0))^{\sum_{i=1}^{100}1_{\{X_i<0\}}}\left(1-P(X\leq 0)\right)^{100-
\sum_{i=1}^{100}1_{\{X_i<0\}}}$$
$$=P(X\leq 0)^{40}\left(1-P(X\leq 0)\right)^{60}=\Phi(-\mu)^{40}\left(1-\Phi(-\mu))\right)^{60}$$
So we obtain  $\hat{\Phi}(-\mu)=.4$, and by  Functional_invariance property of MLE $\hat{\mu}=-\Phi^{-1}(.4) $(as  @StubbornAtom mentioned).
A: Depending on the setting, you may have recorded the value of $X_i$ when it is smaller than zero.
So Just for the record, I will try to put a better way.
We first have to know the distribution of the truncated Normal distribution.
The PDF and CDF is the same as the normal distribution when $X<0$ but CDF have a sharp increase at $X=0$, the amount of the increase is the survival function of $N(\mu,1)$ at $0$, $S(0)=0.5(1-\dfrac {erf(-\mu)}{\sigma\sqrt2})$
We can then consider the likelihood function $L(\mu)=S(0)^{60}\prod_{i=1}^{40}f(r_i)$, where $f(
x)$ is the pdf of $N(\mu,1)$ and $r_i$ are recorded value. The rest is just taking maximize the likelihood function.
