The MM1 approximation is not valid if the support of the secondary variables is larger than the support of the primary variable. In this case, the covariances C_{1, j} can be approximated as follows (MM2 hypothesis):
covariance_vector | is an object that has member function covariance_vector[int i], that returns element i of the vector (i is greater than or equal to 0). The elements of the vector must be models of Covariance. covariance_vector must also have a copy constructor. | |
matrix | is an object that represents a matrix. Expression mat(i,j) must be valid and return element (i,j) of the matrix (i and j are greater than or equal to 1), and the matrix must have a copy constructor. The elements of matrix are of type convertible to double. |
Matrix A contains the covariance values C_{i, j}(0). Notice that matrix A contains numbers, not pointers to functions as in LMC.
size is the size of the covariance matrix. It is equal to the number of variables N_{v}.