Description Usage Arguments Details Value Author(s) See Also Examples

Models faecal egg counts data in a one-sample case with (zero-inflated) Poisson-gamma model formulation using Stan modelling language. It is computationally several-fold faster compared to conventional MCMC techniques. For the installation instruction of Stan, please read https://github.com/stan-dev/rstan/wiki/RStan-Getting-Started.

1 2 3 4 |

`fec` |
vector of faecal egg counts |

`rawCounts` |
logical. If true, |

`CF` |
a positive integer or a vector of positive integers. Correction factor(s) |

`zeroInflation` |
logical. If true, uses the model with zero-inflation. Otherwise uses the model without zero-inflation |

`muPrior` |
a list with hyper-prior information for the group mean epg parameter |

`kappaPrior` |
a list with hyper-prior information for the group dispersion parameter |

`phiPrior` |
a list with hyper-prior information for zero-inflation parameter. The default prior is |

`nsamples` |
a positive integer specifying the number of samples for each chain (including burn-in samples) |

`nburnin` |
a positive integer specifying the number of burn-in samples |

`thinning` |
a positive integer specifying the thinning parameter, the period for saving samples |

`nchain` |
a positive integer specifying the number of chains |

`ncore` |
a positive integer specifying the number of cores to use when executing the chains in parallel |

`adaptDelta` |
the target acceptance rate, a numeric value between 0 and 1 |

`saveAll` |
logical. If TRUE, posterior samples for all parameters are saved in the |

`verbose` |
logical. If true, prints progress and debugging information |

The first time each non-default model is applied, it can take up to 20 seconds for Stan to compile the model. Currently the function only support prior distributions with two parameters. For a complete list of supported priors and their parameterization, please consult the list of distributions in Stan http://mc-stan.org/documentation/.

The default number of samples per chain is 2000, with 1000 burn-in samples. Normally this is sufficient in Stan. If the chains do not converge, one should tune the MCMC parameters until convergence is reached to ensure reliable results.

Prints out summary of `meanEPG`

as the posterior mean epg. The posterior summary contains the mean, standard deviation (sd), 2.5%, 50% and 97.5% percentiles, the 95% highest posterior density interval (HPDLow95 and HPDHigh95) and the posterior mode. NOTE: we recommend to use the 95% HPD interval and the mode for further statistical analysis.

The returned value is a list that consists of:

`stan.samples` |
An object of S4 class |

`posterior.summary` |
A data frame that is the same as the printed posterior summary. |

Craig Wang

`simData1s`

for simulating faecal egg count data with one sample

1 2 3 4 5 6 7 8 9 |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.