---
title: "direct estimation"
type: concept
related: [Direct Sampling, Direct Estimation, Maximum Likelihood Parameter Learning]
source: https://www.jemoka.com/posts/kbhdirect_estimation/
confidence: high
status: active
---

direct estimation of the probability of failure:
perform a rollout of the system label the outcome as \(1\) if the trajectory is a failure, and \(0\) otherwise this is just Direct Sampling.
From there, we can just go about estimating this using standard parameter estimation (i.e. using MLE estimation or Baysian estimation.)
maximum-likelihood estimation of failure distribution \begin{equation} \hat{p}_{\text{fail}} = \frac{1}{m} \sum_{i=1}^{m} 1\qty {\tau_{i} \not \in \psi} = \frac{n}{m} \end{equation}
for \(n\) failures and \(m\) rollouts, where \(\tau \sim p\qty(\cdot)\).
Bayesian estimation of failure distribution \begin{equation} p \qty(\theta | D) = \frac{p\qty(D| \theta) p\qty(\theta)}{\int_{\theta} p\qty(D | \theta) p\qty(\theta) \dd{\theta}} \end{equation}
whereby \(\theta := p_{\text{fail}}\), \(n\) is the number of failures, \(m\) is the number of total trials
\begin{equation} \hat{p}_{\text{fail}} \sim \text{Beta}\qty(\alpha + n, \beta + m - n) \end{equation}
