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 M[, , i] (resp. M[[i]]) contains the i-th correlation matrix of dimension q by q.

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 list(name=value). See ‘Details’.

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 x.

predict

a list of estimated correlation matrices at xOut. Included if xOut is not NULL.

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

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)
)

[Package frechet version 0.3.0 Index]