View source: R/extract_draws.R
spread_draws | R Documentation |
Useful to convert MCMC chain draws of particular parameters or output from the model object to a wide format for further data wrangling
spread_draws(mod, ..., transformed = FALSE)
mod |
an object of class "plm0","plm","gplm0" or "gplm". |
... |
any number of character vectors containing valid names of parameters in the model or "rating_curve" and "rating_curve_mean". Also accepts "latent_parameters" and "hyperparameters". |
transformed |
boolean value determining whether the output is to be represented on the transformed scale used for sampling in the MCMC chain or the original scale. Defaults to FALSE. |
Data frame with columns
chain
iter
param
value
B. Hrafnkelsson, H. Sigurdarson, S.M. Gardarsson, 2020, Generalization of the power-law rating curve using hydrodynamic theory and Bayesian hierarchical modeling. arXiv preprint 2010.04769
plm0
, plm
, gplm0
, gplm
for further information on parameters
data(krokfors)
set.seed(1)
plm0.fit <- plm0(formula=Q~W,data=krokfors,num_cores=2)
hyp_samples <- spread_draws(plm0.fit,'hyperparameters')
head(hyp_samples)
rating_curve_samples <- spread_draws(plm0.fit,'rating_curve','rating_curve_mean')
head(rating_curve_samples)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.