% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/learning.R
\name{risk_post_prob}
\alias{risk_post_prob}
\title{Posterior Risk Probability.}
\usage{
risk_post_prob(
  cause_probs,
  risks_given_causes,
  risks_given_not_causes,
  observed_causes
)
}
\arguments{
\item{cause_probs}{A vector of prior probabilities for each root cause 'C_i'.}

\item{risks_given_causes}{A vector of conditional probabilities of the risk event 'R' given each cause 'C_i'.}

\item{risks_given_not_causes}{A vector of conditional probabilities of the risk event 'R' given not each cause 'C_i'.}

\item{observed_causes}{A vector of observed values for each cause 'C_i' (1 if observed, 0 if not observed, NA if unobserved).}
}
\value{
A numeric value for the posterior probability of the risk event given the observed causes.
}
\description{
This function calculates the posterior probability of a risk event 'R' occurring
based on observations of multiple root causes and their associated conditional probabilities.
}
\examples{
cause_probs <- c(0.3, 0.2)
risks_given_causes <- c(0.8, 0.6)
risks_given_not_causes <- c(0.2, 0.4)
observed_causes <- c(1, NA)
risk_post_prob <- risk_post_prob(
  cause_probs, risks_given_causes,
  risks_given_not_causes, observed_causes
)
print(risk_post_prob)
}
\references{
Damnjanovic, Ivan, and Kenneth Reinschmidt. Data analytics for engineering and
construction project risk management. No. 172534. Cham, Switzerland: Springer, 2020.
}
