I am trying to fit a log-normal distribution to a time-to-failure data of a product, but the data to which I want to fit the distribution is not regular data. In the data, every row $i$ has two pieces of information about the time to failure.
- The time($t_i$) for which the item $i$ was observed.
- A binary variable $y_i\in \{0,1\}$ indicating whether the item had failed before time $t_i$ (1 if failed, 0 otherwise).
So, the data looks something like this.
Observed Time($t_i$) | failed ? ($y_i$) |
---|---|
5 hrs | 1 |
6 hrs | 0 |
5 hrs | 0 |
7 hrs | 1 |
I emphasize that the time $t_i$ is not the actual failure time. If item $i$ fails ($y_i=1$), $t_i$ is just an upper limit of the failure time. If $i$ doesn't fail ($y_i=0$) then $t_i$ is the lower limit of the failure time.
Now, if we assume all the items are identical and their time to failure is a random variable $\hat t$ that follows a log-normal distribution with parameters $\alpha = (\mu.\sigma)$, then the probability that product $i$ would fail before observation time $t_i$ is $p_i = \Pr(\hat t<t_i) = F(t_i; \mu, \sigma)$ where$F(.)$ is the CDF of log-normal distribution.
So, for every observation $i$, using the probability of failure $p_i$ and the actual label ($y_i$) denoting whether the product failed, we can construct a log-likelihood function like this $$y_i \ln(p_i) + (1-y_i)\ln(1-p_i) = y_i \ln(F(t_i; \mu, \sigma)) + (1-y_i)\ln(1-F(t_i; \mu, \sigma))$$ Note: This is simlar to loss function of a binary logistic regression
We can define the log-loss for the whole data ($n$ datapoints) as $$-\sum_{i=1}^n y_i \ln(F(t_i; \mu, \sigma)) + (1-y_i)\ln(1-F(t_i; \mu, \sigma))$$
We can minimize this loss-function over $\mu, \sigma$ and get the estimate of $\mu, \sigma$.
But after finding $\mu, \sigma$, how do I know that the log-normal distribution is a good fit? I don't have the actual values of the observations to do something like a KS test