summaryrefslogtreecommitdiffstats
path: root/man
diff options
context:
space:
mode:
authorGuillaume Horel <guillaume.horel@serenitascapital.com>2015-07-30 15:17:00 -0400
committerGuillaume Horel <guillaume.horel@serenitascapital.com>2015-07-30 15:17:00 -0400
commitd2e3b9cb9758b22887dfaf0118c9e3e1085e28d8 (patch)
treee38df0cd40d2aaa982c3836d392ff86c6275e1aa /man
parent3cab7807e4d31a1cda940b9b3e160a1a7cf10a09 (diff)
downloadlossdistrib-d2e3b9cb9758b22887dfaf0118c9e3e1085e28d8.tar.gz
add generated docs
Diffstat (limited to 'man')
-rw-r--r--man/GHquad.Rd25
-rw-r--r--man/lossdist.joint.Rd34
-rw-r--r--man/lossdistrib.Rd24
-rw-r--r--man/lossdistrib.fft.Rd26
-rw-r--r--man/lossdistrib2.Rd28
-rw-r--r--man/lossdistrib2.truncated.Rd34
6 files changed, 171 insertions, 0 deletions
diff --git a/man/GHquad.Rd b/man/GHquad.Rd
new file mode 100644
index 0000000..a72a1f2
--- /dev/null
+++ b/man/GHquad.Rd
@@ -0,0 +1,25 @@
+% Generated by roxygen2 (4.1.1): do not edit by hand
+% Please edit documentation in R/distrib.R
+\name{GHquad}
+\alias{GHquad}
+\title{Gauss-Hermite quadrature weights}
+\usage{
+GHquad(n)
+}
+\arguments{
+\item{n}{Integer, the number of nodes}
+}
+\value{
+A list with two components:
+ \item{Z}{the list of nodes}
+ \item{w}{the corresponding weights}
+}
+\description{
+\code{GHquad} computes the quadrature weights for integrating against a
+Gaussian distribution.
+}
+\details{
+if f is a function, then with(GHquad(100), crossprod(f(Z), w))
+will compute \eqn{\frac{1}{\sqrt{2\pi}}\int_-\infty^\infty f(x)e^{-\frac{x^2}{2}}\,dx}.
+}
+
diff --git a/man/lossdist.joint.Rd b/man/lossdist.joint.Rd
new file mode 100644
index 0000000..c3354af
--- /dev/null
+++ b/man/lossdist.joint.Rd
@@ -0,0 +1,34 @@
+% Generated by roxygen2 (4.1.1): do not edit by hand
+% Please edit documentation in R/distrib.R
+\name{lossdist.joint}
+\alias{lossdist.joint}
+\title{recursive algorithm with first order correction to compute the joint
+probability distribution of the loss and recovery.
+For high severities, M can become bigger than N, and there is
+some probability mass escaping.}
+\usage{
+lossdist.joint(p, w, S, N, defaultflag = FALSE)
+}
+\arguments{
+\item{p}{Numeric, vector of default probabilities}
+
+\item{w}{Numeric, vector of weights}
+
+\item{S}{Numeric, vector of severities}
+
+\item{N}{Integer, number of ticks in the grid}
+
+\item{cutoff}{Integer, where to stop computing the exact probabilities}
+}
+\value{
+q Matrix of joint loss, recovery probability distribution
+colSums(q) is the recovery distribution marginal
+rowSums(q) is the loss distribution marginal
+}
+\description{
+recursive algorithm with first order correction to compute the joint
+probability distribution of the loss and recovery.
+For high severities, M can become bigger than N, and there is
+some probability mass escaping.
+}
+
diff --git a/man/lossdistrib.Rd b/man/lossdistrib.Rd
new file mode 100644
index 0000000..3479628
--- /dev/null
+++ b/man/lossdistrib.Rd
@@ -0,0 +1,24 @@
+% Generated by roxygen2 (4.1.1): do not edit by hand
+% Please edit documentation in R/distrib.R
+\name{lossdistrib}
+\alias{lossdistrib}
+\title{Loss distribution of a portfolio}
+\usage{
+lossdistrib(p)
+}
+\arguments{
+\item{p}{Numeric vector, the vector of success probabilities}
+}
+\value{
+A vector q such that q[k]=P(S=k)
+}
+\description{
+\code{lossdistrib} computes the probability distribution of a sum
+of independent Bernouilli variables with unequal probabilities.
+}
+\details{
+This uses the basic recursive algorithm of Andersen, Sidenius and Basu
+We compute the probability distribution of S = \sum_{i=1}^n X_i
+where X_i is Bernouilli(p_i)
+}
+
diff --git a/man/lossdistrib.fft.Rd b/man/lossdistrib.fft.Rd
new file mode 100644
index 0000000..7f86f10
--- /dev/null
+++ b/man/lossdistrib.fft.Rd
@@ -0,0 +1,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 q[k]=P(S=k)
+}
+\description{
+\code{lossdistrib.fft} computes the probability distribution of a sum
+of independent Bernouilli variables with unequal probabilities.
+}
+\details{
+This uses the fft. Complexity is of order O(n m) + O(m\log{m})
+where m is the size of the grid and n, the number of probabilities.
+It is slower than the recursive algorithm in practice.
+We compute the probability distribution of S = \sum_{i=1}^n X_i
+where X_i is Bernouilli(p_i)
+}
+
diff --git a/man/lossdistrib2.Rd b/man/lossdistrib2.Rd
new file mode 100644
index 0000000..d62afb4
--- /dev/null
+++ b/man/lossdistrib2.Rd
@@ -0,0 +1,28 @@
+% Generated by roxygen2 (4.1.1): do not edit by hand
+% Please edit documentation in R/distrib.R
+\name{lossdistrib2}
+\alias{lossdistrib2}
+\title{recursive algorithm with first order correction}
+\usage{
+lossdistrib2(p, w, S, N, defaultflag = FALSE)
+}
+\arguments{
+\item{p}{Numeric, vector of default probabilities}
+
+\item{w}{Numeric, vector of weights}
+
+\item{S}{Numeric, vector of severities}
+
+\item{N}{Integer, number of ticks in the grid}
+
+\item{defaultflag}{Boolean, if True, we compute the default distribution
+(instead of the loss distribution).}
+}
+\value{
+a Numeric vector of size \code{N} computing the loss (resp.
+default) distribution if \code{defaultflag} is FALSE (resp. TRUE).
+}
+\description{
+recursive algorithm with first order correction
+}
+
diff --git a/man/lossdistrib2.truncated.Rd b/man/lossdistrib2.truncated.Rd
new file mode 100644
index 0000000..2a488e9
--- /dev/null
+++ b/man/lossdistrib2.truncated.Rd
@@ -0,0 +1,34 @@
+% Generated by roxygen2 (4.1.1): do not edit by hand
+% Please edit documentation in R/distrib.R
+\name{lossdistrib2.truncated}
+\alias{lossdistrib2.truncated}
+\title{recursive algorithm with first order correction truncated version
+this is actually slower than lossdistrib2. But in C this is
+twice as fast.
+For high severities, M can become bigger than N, and there is
+some probability mass escaping.}
+\usage{
+lossdistrib2.truncated(p, w, S, N, cutoff = N)
+}
+\arguments{
+\item{p}{Numeric, vector of default probabilities}
+
+\item{w}{Numeric, vector of weights}
+
+\item{S}{Numeric, vector of severities}
+
+\item{N}{Integer, number of ticks in the grid}
+
+\item{cutoff}{Integer, where to stop computing the exact probabilities}
+}
+\value{
+a Numeric vector of size \code{N} computing the loss distribution
+}
+\description{
+recursive algorithm with first order correction truncated version
+this is actually slower than lossdistrib2. But in C this is
+twice as fast.
+For high severities, M can become bigger than N, and there is
+some probability mass escaping.
+}
+