combineCorMatsR: Combine correlation matrices.

Description Usage Arguments Details Value See Also Examples

View source: R/getCoxMatsR.R

Description

combineCorMatsR returns a correlation matrix that is a weighted sum of two other correlation matrices.

Usage

1
combineCorMatsR(w, G, L)

Arguments

w

A scalar between 0 and 1. In the bcgp setting, the user will have set a lower and upper bound (the default is to be between 0.5 and 1).

G

An n x n correlation matrix, often the result of getCorMat.

L

An n x n correlation matrix, often the result of getCorMat.

Details

This creates a correlation matrix, R, where

R = wG + (1-w)L

. In the bcgp setting, G is the global correlation matrix, L is the local correlation matrix, and w is the weight.

Value

An n x n correlation matrix

See Also

Other correlation and covariance functions: getCorMatR, getCovMatNSR, getCovMatSR

Examples

1
2
3
4
5
6
7
8
9
n <- 10
d <- 2
x <- matrix(runif(n * d), nrow = n, ncol = d)
rhoG <- runif(d, 0, 1)
rhoL <- runif(d, 0, rhoG)
G <- getCorMat(x, rhoG)
L <- getCorMat(x, rhoL)
w <- runif(1, 0.5, 1)
combineCorMatsR(w, G, L)

cbdavis33/bcgp documentation built on Oct. 1, 2019, 8:07 a.m.