example_model_2chains: Example of a hierarchical model

example_model_2chainsR Documentation

Example of a hierarchical model

Description

Example of a hierarchical model

Usage

example_model_2chains

Format

A hierarchical model created by fit_model() with two chains of 100 MCMC iterations. It is a named list of 4 objects:

graph_measurements

A data frame of model training data that shows the writer, document name, cluster assignment, slope, principle component rotation angle, and wrapped principle component rotation angle for each training graph.

cluster_fill_counts

A data frame of the cluster fill counts for each model training document.

rjags_data

The model training information from graph_measurements and cluster_fill_counts formatted for RJAGS.

fitted_model

A model fit using the rjags_data and the RJAGS and coda packages. It is an MCMC list that contains an MCMC object for each chain.

Examples

# convert to a data frame and view all variable names
df <- as.data.frame(coda::as.mcmc(example_model_1chain$fitted_model))
colnames(df)

# view a trace plot
plot_trace(variable = "mu[1,1]", model = example_model_2chains)

# drop the first 25 MCMC iterations from each chain for burn-in
model <- drop_burnin(model = example_model_2chains, burn_in = 25)

## Not run: 
# analyze questioned documents
template_dir <- /path/to/cluster_template_directory
questioned_images_dir <- /path/to/questioned_documents_directory
analysis <- analyze_questioned_documents(
   template_dir = template_dir,
   questioned_images_dir = questioned_images_dir
   model = example_model_2chains
   num_cores = 2
)
analysis$posterior_probabilities

## End(Not run)


handwriter documentation built on Oct. 13, 2023, 5:10 p.m.