Re-parameterise the mixture proportions so that when there is more than a 2-point mixture, the proportions sum to 1.

1 | ```
inv.reparam.pi(mix.prop, lastpar = FALSE)
``` |

`mix.prop` |
A set of mixture proportions. |

`lastpar` |
Is the last parameter provided, i.e. does sum(mix.prop)=1? |

a vector of parameters

See Miller and Thomas for information on exactly how these are calculated. Thanks go to David Borchers for proposing the trick.

David L. Miller

Miller, D.L. and L. Thomas (in prep.). Mixture model distance sampling detection functions.

reparam.pi

1 2 3 | ```
library(mmds)
reparam.pi(inv.reparam.pi(0.3))
reparam.pi(inv.reparam.pi(c(0.3,0.4,0.1),lastpar=TRUE))
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

All documentation is copyright its authors; we didn't write any of that.