GloCorReg {frechet} | R Documentation |
Global Fréchet regression for correlation matrices
Description
Global Fréchet regression for correlation matrices with Euclidean predictors.
Usage
GloCorReg(x, M, xOut = NULL, optns = list())
Arguments
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
|
Details
Available control options are
- metric
choice of metric.
'frobenius'
and'power'
are supported, which corresponds to Frobenius metric and Euclidean power metric, respectively. Default is Frobenius metric.- alpha
the power for Euclidean power metric. Default is 1 which corresponds to Frobenius metric.
- digits
the integer indicating the number of decimal places (round) to be kept in the output. Default is NULL, which means no round operation.
Value
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 |
RSquare |
Fréchet coefficient of determination. |
AdjRSquare |
adjusted Fréchet coefficient of determination. |
residuals |
Frobenius distance between the true and fitted correlation matrices. |
xOut |
the output predictor level used. |
optns |
the control options used. |
References
-
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.
Examples
# 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 = x[i], shape2 = 1 - 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 <- GloCorReg(x, y, xOut,
optns = list(metric = "frobenius", digits = 5)
)
# Euclidean power metric
fit2 <- GloCorReg(x, y, xOut,
optns = list(metric = "power", alpha = .5)
)