## distributions.Sampled


A distribution known only through equally weighted draws.


Usage


``` python
distributions.Sampled()
```


## Parameters


`draws: list of float`  
Non-empty, all finite.


## Raises


`ValueError`  
If [draws](distributions.Sampled.md#prospicio.distributions.Sampled.draws) is empty or holds a value that is not finite.


## Examples

``` python
>>> from prospicio.distributions import Sampled
>>> s = Sampled([1.0, 2.0, 3.0, 4.0])
>>> s.tvar(0.5)
```

3.5


## Attributes

| Name | Description |
|----|----|
| [draws](#draws) | The draws, in simulation order. |

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


#### draws


The draws, in simulation order.


`draws: list[float]`


## Methods

| Name | Description |
|----|----|
| [cdf()](#cdf) | Empirical distribution function `P(X <= x)`. |
| [mean()](#mean) | Mean of the draws. |
| [quantile()](#quantile) | Inverted empirical cdf (R `type = 1`). |
| [tvar()](#tvar) | Tail value at risk at level [p](models.Elpd.md#prospicio.models.Elpd.p): the mean of the worst `1 - p`. |
| [var()](#var) | Value at risk at level [p](models.Elpd.md#prospicio.models.Elpd.p). |
| [variance()](#variance) | Variance of the draws (dividing by [n](distributions.Binomial.md#prospicio.distributions.Binomial.n)). |

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


#### cdf()


Empirical distribution function `P(X <= x)`.


Usage


``` python
cdf(x)
```


##### Parameters


`x: float`  


##### Returns


`float`  


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


#### mean()


Mean of the draws.


Usage


``` python
mean()
```


##### Returns


`float`  


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


#### quantile()


Inverted empirical cdf (R `type = 1`).


Usage


``` python
quantile(p)
```


##### Parameters


`p: float`  


##### Returns


`float`  


##### Raises


`ValueError`  
If [p](models.Elpd.md#prospicio.models.Elpd.p) is outside `[0, 1]`.


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


#### tvar()


Tail value at risk at level [p](models.Elpd.md#prospicio.models.Elpd.p): the mean of the worst `1 - p`.


Usage


``` python
tvar(p)
```


##### Parameters


`p: float`  


##### Returns


`float`  


##### Raises


`ValueError`  
If [p](models.Elpd.md#prospicio.models.Elpd.p) is outside `[0, 1]`.


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


#### var()


Value at risk at level [p](models.Elpd.md#prospicio.models.Elpd.p).


Usage


``` python
var(p)
```


##### Parameters


`p: float`  


##### Returns


`float`  


##### Raises


`ValueError`  
If [p](models.Elpd.md#prospicio.models.Elpd.p) is outside `[0, 1]`.


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


#### variance()


Variance of the draws (dividing by [n](distributions.Binomial.md#prospicio.distributions.Binomial.n)).


Usage


``` python
variance()
```


##### Returns


`float`
