Implements the robust estimator of Welz (2025, tools:::Rd_expr_doi("10.48550/arXiv.2510.15632")) for the polyserial correlation model.
polyserial(
x,
y,
alpha = 0.5,
num_y = max(y),
constrained = "ifneeded",
method = NULL,
variance = TRUE,
weights = TRUE,
init = polyserial_initialize_param(x = x, num_y = num_y, robust = TRUE),
maxcor = 0.999,
tol_thresholds = 0.01,
tol_sigma2 = 0.01
)An object of class "polyserial", which is a list with the following components.
thetahatA 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}).
stderrA vector of standard errors for each estimate in thetahat.
vcovEstimated 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.
pointpolyserialEstimated polyserial correlation coefficient, calculated with provided scoring of Y
weightsList of rescaled and raw outlyingness weights for each observation as well as maximum possible raw weight that was used for rescaling (sup).
objectiveValue of minimized loss function.
optimObject of class optim.
inputsList of provided inputs.
Vector of numeric values.
Vector of integer-valued ordinal values.
Tuning constant that governs robustness-efficiency tradeoff; must be in [0, Inf]. Defaults to 0.5.
Number of response categories in y; defaults to max(y)
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".
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.
Shall an estimated asymptotic covariance matrix be returned? Default is TRUE.
Shall weights be returned? Default is TRUE.
Initialization of numerical optimization. Default is neutral.
Maximum absolute correlation (to ensure numerical stability). Default is 0.999.
Minimum distance between consecutive thresholds (to enforce strict monotonicity); only relevant in case of constrained optimization. Default is 0.01.
Minimum value of sigma2 parameter (population variance of X); only relevant in case of constrained optimization. Default is 0.01.
## example data
set.seed(123)
x <- rnorm(n = 100)
y <- sample(c(1,2), size = 100, replace = TRUE)
polyserial(x,y)
Run the code above in your browser using DataLab