Learn R Programming

robcat (version 0.2)

polyserial_mle: Maximum likelihood estimation of polyserial correlation

Description

Implements maximum likelihood estimation of the polyserial correlation model.

Usage

polyserial_mle(
  x,
  y,
  num_y = max(y),
  constrained = "ifneeded",
  method = NULL,
  variance = TRUE,
  init = polyserial_initialize_param(x = x, num_y = num_y, robust = FALSE),
  maxcor = 0.999,
  tol_thresholds = 0.01,
  tol_sigma2 = 0.01
)

Value

An object of class "polyserial", which is a list with the following components.

thetahat

A vector of estimates for the polyserial correlation coefficient (rho), population mean of X (mu), population variance of Y (sigma2), as well as thresholds for y (named tau1,tau2,...,tau_{r-1}).

stderr

A vector of standard errors for each estimate in thetahat.

vcov

Estimated asymptotic covariance matrix of thetahat. The matrix \(\Sigma\) in the paper (asymptotic covariance matrix of \(\sqrt{N} \hat{\theta}\)) can be obtained via vcov * N, where N is the sample size.

pointpolyserial

Estimated polyserial correlation coefficient, calculated with provided scoring of Y

objective

Value of minimized loss function.

optim

Object of class optim.

inputs

List of provided inputs.

Arguments

x

Vector of numeric values.

y

Vector of integer-valued ordinal values.

num_y

Number of response categories in y; defaults to max(y)

constrained

Shall parameter restructions be enforced by linear constraints? This can be a logical (TRUE or FALSE), or "ifneeded" to first try unconstrained optimization and in case of an error perform constrained optimization. Default is "ifneeded".

method

Numerical optimization method, see optim() and constrOptim(). Default is to use "BFGS" in case of unconstrained optimization and "Nelder-Mead" in case of constrained optimization.

variance

Shall an estimated asymptotic covariance matrix be returned? Default is TRUE.

init

Initialization of numerical optimization. Default is neutral.

maxcor

Maximum absolute correlation (to ensure numerical stability). Default is 0.999.

tol_thresholds

Minimum distance between consecutive thresholds (to enforce strict monotonicity); only relevant in case of constrained optimization. Default is 0.01.

tol_sigma2

Minimum value of sigma2 parameter (population variance of X); only relevant in case of constrained optimization. Default is 0.01.

Examples

Run this code
## example data
set.seed(123)
x <- rnorm(n = 100)
y <- sample(c(1,2), size = 100, replace = TRUE)

polyserial_mle(x,y)

Run the code above in your browser using DataLab