## distributions.Normal


The normal distribution, on the whole real line: asset returns, log


Usage

``` python
distributions.Normal()
```


returns and other outcomes of either sign.

Its TVaR is `mu + sigma * phi(z_p) / (1 - p)` with `z_p` the standard normal quantile (*Pricing Insurance Risk*, section 4.3.3): VaR plus a multiple of [sigma](reserving.MackFit.md#prospicio.reserving.MackFit.sigma) that depends only on [p](models.Elpd.md#prospicio.models.Elpd.p).


## Parameters


`mu: float`  
The mean.

`sigma: float`  
The standard deviation, positive.


## Raises


`ValueError`  
If [mu](distributions.Normal.md#prospicio.distributions.Normal.mu) is not finite or [sigma](reserving.MackFit.md#prospicio.reserving.MackFit.sigma) not finite and positive.


## Examples

``` python
>>> from prospicio.distributions import Normal
>>> x = Normal(0.0, 1.0)
>>> round(x.quantile(0.99), 6), round(x.tvar(0.99), 6)
```

(2.326348, 2.665214)


## Attributes

| Name | Description |
|----|----|
| [mu](#mu) | The mean. |
| [sigma](#sigma) | The standard deviation. |

------------------------------------------------------------------------


#### mu


The mean.


`mu: float`


------------------------------------------------------------------------


#### sigma


The standard deviation.


`sigma: float`


## Methods

| Name | Description |
|----|----|
| [cdf()](#cdf) | `P(X <= x)`. |
| [mean()](#mean) | The mean. |
| [pdf()](#pdf) | The density. |
| [quantile()](#quantile) | The quantile at [p](models.Elpd.md#prospicio.models.Elpd.p). |
| [sample()](#sample) | [n](pricing.TrendFit.md#prospicio.pricing.TrendFit.n) draws from stream `stream` of the generator keyed by [seed](aggregate.EventSet.md#prospicio.aggregate.EventSet.seed). |
| [std_dev()](#std_dev) | The standard deviation. |
| [survival()](#survival) | `P(X > x)`, precise far in the upper tail. |
| [tvar()](#tvar) | Tail value at risk at [p](models.Elpd.md#prospicio.models.Elpd.p), `E[X | X >= VaR(p)]`. |
| [variance()](#variance) | The variance. |

------------------------------------------------------------------------


#### cdf()


`P(X <= x)`.


Usage

``` python
cdf(x)
```


##### Parameters


`x: float`  


##### Returns


`float`  


------------------------------------------------------------------------


#### mean()


The mean.


Usage

``` python
mean()
```


##### Returns


`float`  


------------------------------------------------------------------------


#### pdf()


The density.


Usage

``` python
pdf(x)
```


##### Parameters


`x: float`  


##### Returns


`float`  


------------------------------------------------------------------------


#### quantile()


The quantile at [p](models.Elpd.md#prospicio.models.Elpd.p).


Usage

``` python
quantile(p)
```


##### Parameters


`p: float`  
In `[0, 1]`.


##### Returns


`float`  


------------------------------------------------------------------------


#### sample()


[n](pricing.TrendFit.md#prospicio.pricing.TrendFit.n) draws from stream `stream` of the generator keyed by [seed](aggregate.EventSet.md#prospicio.aggregate.EventSet.seed).


Usage

``` python
sample(n, seed, stream=0)
```


##### Parameters


`n: int`  

`seed: int`  

`stream: int = ``0`  


##### Returns


`list of float`  


------------------------------------------------------------------------


#### std_dev()


The standard deviation.


Usage

``` python
std_dev()
```


##### Returns


`float`  


------------------------------------------------------------------------


#### survival()


`P(X > x)`, precise far in the upper tail.


Usage

``` python
survival(x)
```


##### Parameters


`x: float`  


##### Returns


`float`  


------------------------------------------------------------------------


#### tvar()


Tail value at risk at [p](models.Elpd.md#prospicio.models.Elpd.p), `E[X | X >= VaR(p)]`.


Usage

``` python
tvar(p)
```


##### Parameters


`p: float`  
In `[0, 1)`.


##### Returns


`float`  


------------------------------------------------------------------------


#### variance()


The variance.


Usage

``` python
variance()
```


##### Returns


`float`
