Implements maximum likelihood estimation of the polyserial correlation model.
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
)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
objectiveValue of minimized loss function.
optimObject of class optim.
inputsList of provided inputs.
Vector of numeric values.
Vector of integer-valued ordinal values.
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.
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_mle(x,y)
Run the code above in your browser using DataLab