addPriorGroups {causact}R Documentation

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

Description

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

Usage

addPriorGroups(drawsDF)

Arguments

drawsDF

the dataframe created by dag_greta() 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_greta() 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.4.0 Index]