est_C_given_A: Estimate C matrix from an Advantage/Disadvantage matrix

Description Usage Arguments Value Examples

View source: R/est_C_given_A.R

Description

Use this function to estimate a possible C matrix from a skew-symmetric A matrix. Recall that A = C Ω C'. Combined with est_A_from_data(), this might be useful for warm starting mELO models.

Usage

1
est_C_given_A(A_mat, k = 1)

Arguments

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.

Value

A list with three components:

C_mat

The estimated C matrix

error

The squared reconstruction error

est_req_k

The estimated required value for k to minimise the reconstruction error.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# 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

C_mat_list <- find_C_given_A(A_mat)
C_mat_list

dclaz/mELO documentation built on May 17, 2021, 2:27 a.m.