OTHist: Optimal Transport Histogram

Description Details Public fields Methods Examples

Description

Histogram

Details

Just a generic class which contains two arguments, p (probability) and c (center of bins)

Public fields

p

[vector] Vector of probability

c

[matrix] Vector of center of bins, with nrow = n_samples and ncol = n_features

bin_width

[vector or NULL] A vector of lengths of the cells discretizing R^numbers of variables. If NULL, it is estimating during the fit

bin_origin

[vector or NULL] Coordinate of lower corner of one cell. If NULL, c(0,...,0) is used

Methods

Public methods


Method new()

Create a new OTHist object.

Usage
OTHist$new(p, c)
Arguments
p

[vector] Vector of probability

c

[matrix] Vector of center of bins, with nrow = n_samples and ncol = n_features

Returns

A new 'OTHist' object.


Method clone()

The objects of this class are cloneable with this method.

Usage
OTHist$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Examples

1
2
3
4
5
## Build a random discrete probability distribution
p = stats::rnorm(100)
p = p / base::sum(p)
c = base::seq( -1 , 1 , length = 100 )
mu = OTHist$new( p , c )

SBCK documentation built on April 10, 2021, 9:06 a.m.

Related to OTHist in SBCK...