summaryrefslogtreecommitdiffstats
path: root/man/lossdistrib.fft.Rd
blob: c4eae10f311792518063436005f75919df76057a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
% Generated by roxygen2 (4.1.1): 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.
}
\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 omplexity is of order \eqn{O(n m) + O(m\log(m))}
where \eqn{m} is the size of the grid and \eqn{n}, the number of probabilities.
It is slower than the recursive algorithm in practice.
}