dotpW-methods: Dot product of two histograms

dotpWR Documentation

Dot product of two histograms

Description

Computes the dot product, inducing the L2 Wasserstein metric, between two distributionH objects, or between a distributionH and a number (considered as an impulse distribution).

Usage

dotpW(e1, e2)

Arguments

e1, e2

Two distributionH objects, or a distributionH and a number.

Value

A number.

References

Irpino, A., Verde, R. (2015) Basic statistics for distributional symbolic variables: a new metric-based approach, Advances in Data Analysis and Classification, 9(2), 143-175. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/s11634-014-0176-4")}

Examples

mydist1 <- distributionH(x = c(1, 2, 3, 10), p = c(0, 0.1, 0.5, 1))
mydist2 <- distributionH(x = c(5, 7, 15), p = c(0, 0.7, 1))
dotpW(mydist1, mydist2) # 39.51429
dotpW(mydist1, 3) # 13.2
dotpW(3, mydist1) # 13.2

HistDAWass documentation built on Oct. 29, 2026, 5:07 p.m.