rFactorTree {FactorCopula} | R Documentation |
Simulation of 1- and 2-factor tree copula models for item response data
Description
Simulating item response data from the 1- and 2-factor tree copula models.
Usage
r1factortree(n, d, A, copname1, copnametree, theta1, delta,K)
r2factortree(n, d, A, copname1, copname2, copnametree,theta1, theta2, delta,K)
Arguments
n |
Sample size. |
d |
Number of observed variables/items. |
A |
|
theta1 |
copula parameter vector of size |
theta2 |
copula parameter vector of size |
delta |
copula parameter vector of size |
copname1 |
A name of a bivariate copula that link each of the oberved variabels with the first factor (note only a single copula family for all items with the factor). Choices are “bvn” for BVN, “bvt |
copname2 |
A name of a bivariate copula that link each of the oberved variabels with the second factor (note only a single copula family for all items with the factor). Choices are “bvn” for BVN, “bvt |
copnametree |
A name of a bivariate copula that link each of the oberved variabels with one another given the factors in the 1-truncated vine (note only a single copula family for all tree). Choices are “bvn” for BVN, “bvt |
K |
Number of categories for the observed variables/items. |
Value
Data matrix of dimension n \times d
, where n
is the sample size, and d
is the total number of observed variables/items.
Author(s)
Sayed H. Kadhem
Aristidis K. Nikoloulopoulos a.nikoloulopoulos@uea.ac.uk
References
Joe, H. (2014). Dependence Modelling with Copulas. Chapman & Hall, London.
Kadhem, S.H. and Nikoloulopoulos, A.K. (2022b) Factor tree copula models for item response data. Arxiv e-prints, <arXiv: 2201.00339>. https://arxiv.org/abs/2201.00339.
Examples
# ---------------------------------------------------
# ---------------------------------------------------
#Sample size
n = 500
#Ordinal Variables ---------------------------------
d = 5
#Categories for ordinal ----------------------------
K = 5
# ---------------------------------------------------
# 1-2-factor tree copula model
# ---------------------------------------------------
#Copula parameters
theta1 = rep(3, d)
theta2 = rep(2, d)
delta = rep(1.5, d-1)
#Copula names
copulaname_1f = "gum"
copulaname_2f = "gum"
copulaname_vine = "gum"
#vine array
#Dvine
d=5
A=matrix(0,d,d)
A[1,]=c(1,c(1:(d-1)))
diag(A)=1:d
#----------------- Simulating data ------------------
#1-factor tree copula
data_1ft = r1factortree(n, d, A, copulaname_1f, copulaname_vine,
theta1, delta,K)
#2-factor tree copula
data_2ft = r2factortree(n, d, A, copulaname_1f, copulaname_2f,
copulaname_vine, theta1,theta2, delta,K)