## risk.rearrange()


The Rearrangement Algorithm (Puccetti and Rueschendorf): orders each


Usage


``` python
risk.rearrange(
    columns,
    rotate=None,
    seed=None,
    tolerance=1e-06,
)
```


column opposite to the sum of the others until the smallest row sum stops rising by [tolerance](reserving.ApcGlm.md#prospicio.reserving.ApcGlm.tolerance). Its answer depends on the start: as given, column `j` rotated down by `rotate * j` places, or each column shuffled from [seed](aggregate.EventSet.md#prospicio.aggregate.EventSet.seed).


## Parameters


`columns: list of list of float`  
Equal lengths.

`rotate: int = None`  

`seed: int = None`  

`tolerance: float = ``1e-6`  


## Returns


`dict`  
[value](reserving.CalendarIndex.md#prospicio.reserving.CalendarIndex.value) (the smallest row sum), [columns](reserving.Triangle.md#prospicio.reserving.Triangle.columns) (the final arrangement) and [iterations](models.GlmFit.md#prospicio.models.GlmFit.iterations).


## Examples

``` python
>>> from prospicio.risk import rearrange
>>> rearrange([[1.0, 2.0, 3.0, 4.0], [1.0, 2.0, 3.0, 4.0]])["value"]
```

5.0
