% Generated by roxygen2: do not edit by hand % Please edit documentation in R/distrib.R \name{lossdistrib.fft} \alias{lossdistrib.fft} \title{Loss distribution of a portfolio} \usage{ lossdistrib.fft(p) } \arguments{ \item{p}{Numeric vector, the vector of success probabilities} } \value{ A vector such that \eqn{q_k=\Pr(S=k)} } \description{ \code{lossdistrib.fft} computes the probability distribution of a sum of independent Bernouilli variables with unequal probabilities (also called the Poisson-Binomial distribution). } \details{ We compute the probability distribution of \eqn{S = \sum_{i=1}^n X_i} where \eqn{X_i} is Bernouilli(\eqn{p_i}). This uses the FFT, thus complexity is of order \eqn{O(n \log(n))}, compared to \eqn{O(n^2)} for the recursive algorithm. }