Yeah, that what I was thinking about, but I struggle to understand how to pass two variables into a mixture (observed_failure and T).
Here is my data generation process:
import scipy.stats as st
import pandas as pd
typical_days_to_failure = st.gamma(a=5, scale=1).rvs(10000)
days_to_failure = st.expon(scale=typical_days_to_failure).rvs(10000)
p_faulty_sensor = 0.1
check_days = np.asarray([np.random.choice(np.arange(0,19))+1 for _ in range(0,10000)])
df_simulated = pd.DataFrame().assign(true_failure=days_to_failure, check_day=check_days).assign(
failure=lambda df: (df.true_failure < df.check_day).astype(int),
faulty_sensor = st.bernoulli(p = p_faulty_sensor).rvs(10000),
observed_failure = lambda df: (1-df.faulty_sensor)*df.failure
)