gpav {HEMDAG} | R Documentation |
Generalized Pool-Adjacent Violators (GPAV)
Description
Implementation of GPAV
(Generalized Pool-Adjacent Violators) algorithm.
(Burdakov et al., In: Di Pillo G, Roma M, editors. An O(n2) Algorithm for Isotonic Regression. Boston, MA: Springer US; 2006.
p. 25–33. Available from: doi: 10.1007/0-387-30065-1_3
Usage
gpav(Y, W = NULL, adj)
Arguments
Y |
vector of scores relative to a single example. |
W |
vector of weight relative to a single example. If |
adj |
adjacency matrix of the graph which must be sparse, logical and upper triangular. Number of columns of |
Details
Given the constraints adjacency matrix of the graph, a vector of scores and a vector of strictly positive
weights
, the
GPAV
algorithm returns a vector which is as close as possible, in the least-squares sense,
to the response vector
and whose components are partially ordered in accordance with the constraints matrix
adj
.
In other words, GPAV
solves the following problem:
where are the number of vertexes of the graph.
Value
A list of 3 elements:
-
YFit
: a named vector with the scores of the classes corrected according to theGPAV
algorithm. -
blocks
: list of vectors, containing the partitioning of nodes (represented with an integer number) into blocks; -
W
: vector of weights.
Examples
data(graph);
data(scores);
Y <- S[3,];
adj <- adj.upper.tri(g);
Y.gpav <- gpav(Y,W=NULL,adj);