rFactorTree | R Documentation |
Simulating item response data from the 1- and 2-factor tree copula models.
r1factortree(n, d, A, copname1, copnametree, theta1, delta,K) r2factortree(n, d, A, copname1, copname2, copnametree,theta1, theta2, delta,K)
n |
Sample size. |
d |
Number of observed variables/items. |
A |
d \times d vine array with 1,...,d on diagonal, note only the first row and diagnoal values are used for the 1-truncated vine model |
theta1 |
copula parameter vector of size d for items with the first factor. |
theta2 |
copula parameter vector of size d for items with the second factor. |
delta |
copula parameter vector of size d-1 for the 1-truncated vine tree (conditional dependence). |
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ν” with ν = \{1, …, 9\} degrees of freedom for t-copula, “frk” for Frank, “gum” for Gumbel, “rgum” for reflected Gumbel, “1rgum” for 1-reflected Gumbel, “2rgum” for 2-reflected Gumbel. |
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ν” with ν = \{1, …, 9\} degrees of freedom for t-copula, “frk” for Frank, “gum” for Gumbel, “rgum” for reflected Gumbel, “1rgum” for 1-reflected Gumbel, “2rgum” for 2-reflected Gumbel. |
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ν” with ν = \{1, …, 9\} degrees of freedom for t-copula, “frk” for Frank, “gum” for Gumbel, “rgum” for reflected Gumbel, “1rgum” for 1-reflected Gumbel, “2rgum” for 2-reflected Gumbel. |
K |
Number of categories for the observed variables/items. |
Data matrix of dimension n \times d, where n is the sample size, and d is the total number of observed variables/items.
Sayed H. Kadhem
Aristidis K. Nikoloulopoulos a.nikoloulopoulos@uea.ac.uk
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.
# --------------------------------------------------- # --------------------------------------------------- #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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.