This function samples the initial number of changepoints from a sparse Poisson prior.

1 | ```
sampleK(mini, maxi, lambda, nb)
``` |

`mini` |
Minimum value. |

`maxi` |
Maximum value. |

`lambda` |
Parameter of the Poisson distribution. |

`nb` |
Number of values to sample. |

The sampled number of changepoints.

Sophie Lebre

For more information on the prior choice and sampling, see:

Dondelinger et al. (2012), "Non-homogeneous dynamic Bayesian networks with Bayesian regularization for inferring gene regulatory networks with gradually time-varying structure", Machine Learning.

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.

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.