DenFMean {frechet}R Documentation

Fréchet means of densities.

Description

Obtain Fréchet means of densities with respect to L^2-Wasserstein distance.

Usage

DenFMean(yin = NULL, hin = NULL, qin = NULL, optns = list())

Arguments

yin

A matrix or list holding the sample of measurements for the observed distributions. If yin is a matrix, each row holds the measurements for one distribution.

hin

A list holding the histograms of an observed distribution.

qin

A matrix or list holding the quantile functions of the response. If qin is a matrix, each row holds the quantile function of an observed distribution taking values on optns$qSup. Note that only one of the three yin, hin, and qin needs to be input. If more than one of them are specified, yin overwrites hin, and hin overwrites qin.

optns

A list of options control parameters specified by list(name=value).

Details

Available control options are qSup, nqSup, bwDen, ndSup, dSup, delta, kernelDen, infSupport, and denLowerThreshold. See LocDenReg for details.

weights

A vector of weights to compute the weighted barycenter. The length of weights is equal to the sample size. Default is equal weights.

Value

A list containing the following components:

dout

A numeric vector holding the density of the Fréchet mean.

dSup

A numeric vector giving the domain grid of dout when it is a matrix.

qout

A numeric vector holding the quantile function of the Fréchet mean.

qSup

A numeric vector giving the domain grid of qout.

optns

A list of control options used.

Examples

xin = seq(0,1,0.05)
yin = lapply(xin, function(x) {
  rnorm(100, rnorm(1,x + x^2,0.005), 0.05)
})
res <- DenFMean(yin=yin)
plot(res)


[Package frechet version 0.3.0 Index]