Learn R Programming

prolsirm (version 0.1.1)

procrustes: procrustes

Description

Procrustes matching of posterior samples of latent positions of persons ( z) and items (w) from LSIRM with q-dimensional interaction map

Usage

procrustes(z, w, ref = 1, dilation = FALSE)

Value

A list of M matched posterior samples of z and a list of M matched posterior samples of w.

Arguments

z

A list of length M. M posterior samples of person latent positions N x q, where N is the number of respondents and q is the dimension of the interaction map.

w

A list of length M. M posterior samples of item latent positions I x q, where I is the number of items and q is the dimension of the interaction map.

ref

Reference configuration (i.e., iteration) index. Default is 1 (i.e., posterior samples at iteration 1) ).

dilation

Logical; allow *uniform scaling* during alignment (default FALSE). Set TRUE only for plotting/overlay use cases.

Details

The function performs Procrustes matching by aligning the M-1 posterior samples of z and w to the reference configuration (e.g., iteration 1). Users can select any configuration as the reference with the ref argument. The function returns M matched lists of z and w after the Procrustes matching process.

References

Borg and Groenen. 1997. Modern Multidimensional Scaling. New York: Springer. pp. 340-342.

Jeon, M., Jin, I. H., Schweinberger, M., & Baugh, S. 2021. Mapping Unobserved Item–Respondent Interactions: A Latent Space Item Response Model with Interaction Map. Psychometrika, 86(2), 378–403.

Andrew D. Martin, Kevin M. Quinn, Jong Hee Park. 2011. MCMCpack: Markov Chain Monte Carlo in R. Journal of Statistical Software. 42(9): 1-21.

Examples

Run this code
# Load package
library(prolsirm)

# Generate example posterior samples
# M=3 samples of person latent positions (N=50, q=2)
z <- list(matrix(rnorm(100), ncol = 2),
          matrix(rnorm(100), ncol = 2),
          matrix(rnorm(100), ncol = 2))

# M=3 samples of item latent positions (I=5, q=2)
w <- list(matrix(rnorm(10), ncol = 2),
          matrix(rnorm(10), ncol = 2),
          matrix(rnorm(10), ncol = 2))

# Perform Procrustes matching
matched_data <- procrustes(z = z, w = w)

Run the code above in your browser using DataLab