Learn R Programming

matchFeat (version 1.0)

objective.gen.fun: Objective Value in One-To-One Feature Matching with Balanced or Unbalanced Data

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. The data can be balanced OR unbalanced.

Usage

objective.gen.fun(x, unit, cluster)

Value

Objective value

Arguments

x

data matrix with feature vectors in rows

unit

vector of unit labels (length should equal number of rows in x)

cluster

vector of cluster labels (length should equal number of rows in x)

Details

See equation (2) in Degras (2022). This function gives the same value as objective.fun when the data are balanced.

References

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

See Also

objective.fun

Examples

Run this code
data(optdigits)
m <- 10
n <- 100

## Balanced example: both 'objective.fun' and 'objective.gen.fun' work
sigma <- matrix(1:m,m,n)
cluster <- rep(1:m,n)
objective.fun(optdigits$x, sigma, optdigits$unit)
objective.gen.fun(optdigits$x, optdigits$unit, cluster)

## Unbalanced example
idx <- 1:999
objective.gen.fun(optdigits$x[idx,], optdigits$unit[idx], cluster[idx])


Run the code above in your browser using DataLab