Use this function to estimate a possible C matrix from a skew-symmetric A matrix. Recall that \(A = C \Omega C'\). Combined with est_A_from_data(), this might be useful for warm starting mELO models.
est_C_given_A(A_mat, k = 1)
A_mat | An advantage/disadvantage matrix. |
---|---|
k | The number of columns of the C matrix. More complex non-transitive interactions require higher values of k. |
A list with three components:
The estimated C matrix
The squared reconstruction error
The estimated required value for k to minimise the reconstruction error.
# Generate C mat set.seed(112123) m <- 4 k <- 1 C_mat <- matrix( runif(m*2*k, 0, 10), ncol = 2*k ) Omega_mat <- construct_omega(k) A_mat <- C_mat %*% Omega_mat %*% t(C_mat) A_mat#> [,1] [,2] [,3] [,4] #> [1,] 0.00000 16.926723 14.033027 27.323039 #> [2,] -16.92672 0.000000 -8.399661 1.470011 #> [3,] -14.03303 8.399661 0.000000 14.777401 #> [4,] -27.32304 -1.470011 -14.777401 0.000000C_mat_list <- find_C_given_A(A_mat)#> Error in find_C_given_A(A_mat): could not find function "find_C_given_A"C_mat_list#> Error in eval(expr, envir, enclos): object 'C_mat_list' not found