predictive_interval.stanreg in the
rstanarm package for an example.
1 2 3 4
The object to use.
Arguments passed to methods. See the methods in the rstanarm package for examples.
A number p (0 < p < 1) indicating the desired probability mass to include in the intervals.
predictive_interval methods should return a matrix with two
columns and as many rows as data points being predicted. For a given value
prob, p, the columns correspond to the lower and upper
100p% interval limits and have the names 100α/2% and
100(1 - α/2)%, where α = 1-p. For example, if
prob=0.9 is specified (a 90% interval), then the column names
The default method just takes
object to be a matrix and computes
prob defaulting to 0.9.
Guidelines and recommendations for developers of R packages interfacing with Stan and a demonstration getting a simple package working can be found in the vignettes included with rstantools and at http://mc-stan.org/rstantools/articles/.
1 2 3 4 5 6
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.