## risk.simulate()


Simulates marginals joined by a copula.


Usage


``` python
risk.simulate(
    copula,
    marginals,
    n_sims,
    seed,
    keys=None,
    dims=None,
)
```


In simulation `i`, draws uniforms from `copula` with stream `i` of [seed](aggregate.EventSet.md#prospicio.aggregate.EventSet.seed) and applies each marginal's quantile function.


## Parameters


`copula: (GaussianCopula, StudentTCopula or ArchimedeanCopula)`  

`marginals: list of Lognormal, Grid or Pareto-family severities`  
One per copula dimension.

`n_sims: int`  

`seed: int`  

`keys: list of tuple = None`  
One component key per marginal; defaults to `(0,), (1,), ...`.

`dims: list of str = [``"component"]`  


## Returns


`PredictiveDistribution`  


## Examples

``` python
>>> from prospicio.distributions import Lognormal
>>> from prospicio.risk import GaussianCopula, simulate
>>> c = GaussianCopula([[1.0, 0.4], [0.4, 1.0]])
>>> pd = simulate(c, [Lognormal.from_mean_cv(100.0, 0.2), Lognormal.from_mean_cv(50.0, 1.0)],
...               10_000, 42, keys=[("motor",), ("property",)], dims=["lob"])
>>> abs(pd.mean() - 150.0) < 3.0
```

True
