Skip to contents

Pairs plot of all variables sampled

Usage

plot_ggpairs(x, newdata, iterations, nburn, ggpairs_title = "", ...)

Arguments

x

object class 'dpmm_fit'.

newdata

dataframe used in the fitting of the DPMM.

iterations

vector of iterations to be used in the posterior samples (if newdata is provided, this parameter is not used and the iterations are chosen to match the number of rows in newdata)

nburn

number of iterations to discard as burn-in when newdata is provided.

ggpairs_title

title of the pairs plot.

...

other parameters used in GGally::ggpairs.

Value

A pairs plot.

Examples

if (FALSE) {
## load dataset
data(dataset_1)

## fit model
posteriors <- runModel(dataset_1, 
                       mcmc_iterations = 1500,
                       L = 6, 
                       mcmc_chains = 2, 
                       standardise = TRUE)
               
                              
## pairs plot of random draws from the DPMM posterior
plot_ggpairs(posteriors, iterations = seq(500,1500,1))

## pairs plot comparing the original dataset against random draws from the DPMM posterior
plot_ggpairs(posteriors, dataset_1, nburn = 500)
}