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 |
hin |
A list holding the histograms of the response corresponding to each row in |
qin |
A matrix or list holding the quantile functions of the response. If |
xout |
A k by p matrix or a vector of length k (if p=1) with output measurements of the predictors. Default is |
optns |
A list of control parameters specified by |
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 |
dout |
A matrix or list holding the output densities corresponding to |
dSup |
A numeric vector giving the domain grid of |
qout |
A matrix holding the quantile functions of the output densities. Each row corresponds to a value in |
qSup |
A numeric vector giving the domain grid of |
xin |
Input |
din |
Densities corresponding to the input |
qin |
Quantile functions corresponding to the input |
Rsq |
A scalar giving the R squared value if |
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)