LocCorReg | R Documentation |
Local Fréchet regression for correlation matrices with Euclidean predictors.
LocCorReg(x, M, xOut = NULL, optns = list())
x |
an n by p matrix or data frame of predictors. |
M |
a q by q by n array (resp. a list of q by q matrices) where
|
xOut |
an m by p matrix or data frame of output predictor levels. It can be a vector of length p if m = 1. |
optns |
A list of options control parameters specified by
|
Available control options are
choice of metric. 'frobenius'
and 'power'
are supported,
which corresponds to Frobenius metric and Euclidean power metric,
respectively. Default is Frobenius metric.
the power for Euclidean power metric. Default is 1 which corresponds to Frobenius metric.
Name of the kernel function to be chosen from 'gauss'
,
'rect'
, 'epan'
, 'gausvar'
and 'quar'
. Default is 'gauss'
.
bandwidth for local Fréchet regression, if not entered it would be chosen from cross validation.
the integer indicating the number of decimal places (round) to be kept in the output. Default is NULL, which means no round operation.
A corReg
object — a list containing the following fields:
fit |
a list of estimated correlation matrices at |
predict |
a list of estimated correlation matrices at |
residuals |
Frobenius distance between the true and fitted correlation matrices. |
xOut |
the output predictor level used. |
optns |
the control options used. |
Petersen, A. and Müller, H.-G. (2019). Fréchet regression for random objects with Euclidean predictors. The Annals of Statistics, 47(2), 691–719.
# Generate simulation data
n <- 100
q <- 10
d <- q * (q - 1) / 2
xOut <- seq(0.1, 0.9, length.out = 9)
x <- runif(n, min = 0, max = 1)
y <- list()
for (i in 1:n) {
yVec <- rbeta(d, shape1 = sin(pi * x[i]), shape2 = 1 - sin(pi * x[i]))
y[[i]] <- matrix(0, nrow = q, ncol = q)
y[[i]][lower.tri(y[[i]])] <- yVec
y[[i]] <- y[[i]] + t(y[[i]])
diag(y[[i]]) <- 1
}
# Frobenius metric
fit1 <- LocCorReg(x, y, xOut,
optns = list(metric = "frobenius", digits = 2)
)
# Euclidean power metric
fit2 <- LocCorReg(x, y, xOut,
optns = list(
metric = "power", alpha = .5,
kernel = "epan", bw = 0.08
)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.