mppe {bgms}R Documentation

Optimize Pseudoposterior for an Ordinal Markov Random Field Model

Description

The function mppe estimates the parameters for the ordinal MRF by optimizing the pseudoposterior with the Newton-Raphson method.

Usage

mppe(
  x,
  interaction_prior = c("Cauchy", "UnitInfo"),
  cauchy_scale = 2.5,
  threshold_alpha = 0.5,
  threshold_beta = 0.5,
  convergence_criterion = sqrt(.Machine$double.eps),
  maximum_iterations = 1000,
  thresholds,
  interactions
)

Arguments

x

A dataframe or matrix with n rows and p columns, containing binary and ordinal variables for n independent observations and p variables in the network. Variables are recoded as non-negative integers (0, 1, ..., m) if not done already. Unobserved categories are collapsed into other categories after recoding. See reformat_data for details.

interaction_prior

The prior distribution for the interaction effects. Currently, two prior densities are implemented: The Unit Information prior (interaction_prior = "UnitInfo") and the Cauchy prior (interaction_prior = "Cauchy"). Defaults to "Cauchy".

cauchy_scale

The scale of the Cauchy prior for interactions. Defaults to 2.5.

threshold_alpha, threshold_beta

The shape parameters of the Beta-prime prior for the thresholds. Default to 0.5.

convergence_criterion

The convergence criterion for the pseudoposterior values in the EM algorithm. Defaults to sqrt(.Machine$double.eps).

maximum_iterations

The maximum number of EM iterations used. Defaults to 1e3. A warning is issued if the procedure has not converged in maximum_iterations iterations.

thresholds

A matrix with p rows and max(m) columns, containing the category thresholds for each node. Used as starting values in the Newton-Raphson procedure. Optional.

interactions

A matrix with p rows and p columns, containing the pairwise association estimates in the off-diagonal elements. Used as starting values in the Newton-Raphson procedure. Optional.

Value

A list containing:

In the case that interaction_prior = "UnitInfo", the list also contains the p by p matrix unit_info, which contains the asymptotic variances that are used to set the unit information prior for the association effects in the bgms function.


[Package bgms version 0.1.1 Index]