Learn R Programming

matchFeat (version 1.0)

objective.fun: Calculate Cost of Multidimensional Assignment

Description

Calculates the objective value in the multidimensional assignment problem with decomposable costs (MDADC). The dissimilarity function used in this problem is the squared Euclidean distance.

Usage

objective.fun(x, sigma = NULL, unit = NULL, w = NULL)

Value

Objective value

Arguments

x

data: matrix of dimensions \((mn,p)\) or 3D array of dimensions \((p,m,n)\) with \(m\) = number of labels/classes, \(n\) = number of sample units, and \(p\) = number of variables)

sigma

permutations: matrix of dimensions \((m,n)\)

unit

integer (=number of units) or vector mapping rows of x to sample units (length \(mn\)). Must be specified only if x is a matrix.

w

weights for loss function: single positive number, \(p\)-vector of length, or \((p,p)\) positive definite matrix

Details

Given \(n\) datasets having each \(m\) vectors of same size, say \({x_{11},...,x_{1m}},...,x_{n1},...,x_{nm}\), and permutations \(\sigma_1,...,\sigma_n\) of \({1,...,m}\), the function calculates \(1/(n(n-1)) sum_{i,j} sum_{k} || x_{i,sigma_i(k)- x_{j,\sigma_j(k) \|^2}}\) where \(i\) and \(n\) run from 1 to \(n\) and \(k\) runs from 1 to \(m\). This is the objective value (1) of Degras (2021), up to the factor \(1/(n(n-1))\).

References

Degras (2022) "Scalable feature matching across large data collections." tools:::Rd_expr_doi("10.1080/10618600.2022.2074429")

See Also

objective.gen.fun

Examples

Run this code
data(optdigits)
m <- 10
n <- 100
sigma <- matrix(1:m,m,n) # identity permutations
objective.fun(optdigits$x, sigma, optdigits$unit)

Run the code above in your browser using DataLab