Optimize Pseudoposterior for an Ordinal Markov Random Field Model
Source:R/maximum_pseudoposterior.R
mppe.Rd
The function mppe
estimates the parameters for the ordinal MRF
by optimizing the pseudoposterior with the Newton-Raphson method.
Arguments
- x
A dataframe or matrix with
n
rows andp
columns, containing binary and ordinal variables forn
independent observations andp
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. Seereformat_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 inmaximum_iterations
iterations.- thresholds
A matrix with
p
rows andmax(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 andp
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:
interactions
: A matrix withp
rows andp
columns, containing the maximum pseudoposterior estimates of the pairwise associations in the off-diagonal elements.thresholds
: A matrix withp
rows andmax(m)
columns, containing the maximum pseudoposterior estimates of the category thresholds for each node.hessian
: A square matrix withsum(m) + p(p-1)/2
rows and columns, evaluated at the maximum pseudoposterior estimates. The top-left square contains the thresholds, the bottom-right square the associations (of the form(1,2), (1, 3), ..., (2, 1), ...
).
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.