GloDenReg {frechet}R Documentation

Global density regression.

Description

Global Fréchet regression for densities with respect to L^2-Wasserstein distance.

Usage

GloDenReg(
  xin = NULL,
  yin = NULL,
  hin = NULL,
  qin = NULL,
  xout = NULL,
  optns = list()
)

Arguments

xin

An n by p matrix or a vector of length n (if p=1) with input measurements of the predictors.

yin

A matrix or list holding the sample of observations of the response. If yin is a matrix, each row holds the observations of the response corresponding to a row in xin.

hin

A list holding the histograms of the response corresponding to each row in xin.

qin

A matrix or list holding the quantile functions of the response. If qin is a matrix, each row holds the quantile function of the response taking values on optns$qSup corresponding to a row in xin. 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.

xout

A k by p matrix or a vector of length k (if p=1) with output measurements of the predictors. Default is xin.

optns

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

Details

Available control options are qSup, nqSup, lower, upper, Rsquared, bwDen, ndSup, dSup, delta, kernelDen, infSupport, and denLowerThreshold. Rsquared is explained as follows and see LocDenReg for the other options.

Rsquared

A logical variable indicating whether R squared would be returned. Default is FALSE.

Value

A list containing the following components:

xout

Input xout.

dout

A matrix or list holding the output densities corresponding to xout. If dout is a matrix, each row gives a density and the domain grid is given in dSup. If dout is a list, each element is a list of two components, x and y, giving the domain grid and density function values, respectively.

dSup

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

qout

A matrix holding the quantile functions of the output densities. Each row corresponds to a value in xout.

qSup

A numeric vector giving the domain grid of qout.

xin

Input xin.

din

Densities corresponding to the input yin, hin or qin.

qin

Quantile functions corresponding to the input yin, hin or qin.

Rsq

A scalar giving the R squared value if optns$Rsquared = TRUE.

optns

A list of control options used.

References

Petersen, A., & Müller, H.-G. (2019). "Fréchet regression for random objects with Euclidean predictors." The Annals of Statistics, 47(2), 691–719.

Examples

xin = seq(0,1,0.05)
yin = lapply(xin, function(x) {
  rnorm(100, rnorm(1,x,0.005), 0.05)
})
qSup = seq(0,1,0.02)
xout = seq(0,1,0.25)
res1 <- GloDenReg(xin=xin, yin=yin, xout=xout, optns = list(qSup = qSup))
plot(res1)

hin = lapply(yin, function(y) hist(y, breaks = 50, plot=FALSE))
res2 <- GloDenReg(xin=xin, hin=hin, xout=xout, optns = list(qSup = qSup))
plot(res2)


[Package frechet version 0.3.0 Index]