north_west_corner {gridOT} | R Documentation |
North-west-corner Rule
Description
Calculate the transport plan obtained by the north-west-corner rule.
Usage
north_west_corner(wx, wy, threshold = 1e-15)
Arguments
wx |
first weight vector. |
wy |
second weight vector. |
threshold |
small value that indicates when a value is considered to be zero. |
Value
a matrix representing the transport plan obtained by the north-west-corner rule.
Examples
set.seed(1)
wx <- rep(1/5, 5)
wy <- runif(6)
wy <- wy / sum(wy)
north_west_corner(wx, wy)
[Package gridOT version 1.0.1 Index]