addPriorGroups {causact}R Documentation

Group together latent parameters by prior distribution.

Description

[Experimental]

Add a column to a tidy dataframe of draws that groups parameters by their prior distribution. All parameters with the same prior distribution receive the same index.

Usage

addPriorGroups(drawsDF)

Arguments

drawsDF

the dataframe created by dag_numpyro() where each row represents one draw of MCMC output. Two columns are expected, param - the parameter name, value - the realized value, and a third column, priorGroup, is appended as an integer grouping parameters by their prior distributions. The data for this third column is stored in an environment called cacheEnv when the dag_numpyro() function is called. Any parameters with the same prior end up in the same prior group; used by dagp_plot() to group parameters when plotted.

Value

a tidy dataframe of posterior draws. Useful for passing to dagp_plot() or for creating plots using ggplot().


[Package causact version 0.5.4 Index]