x1Ainvx2: Multiply vector times matrix inverse times vector.

Description Usage Arguments Details Value Examples

View source: R/miscFuncs.R

Description

x1Ainvx2 returns a list where each element is the result of multiplying a vector times a matrix inverse times another vector.

Usage

1
x1Ainvx2(x1, A, x2)

Arguments

x1

A list of vectors of length n. Generally, in the bcgp setting, n will be the number of training data locations.

A

An n x n matrix. In the bcgp setting, A is a covariance matrix.

Details

This returns a list where each element is the result of x_1^{\top}A^{-1}x_2

Value

x2 A list of vectors of length n. Generally, in the bcgp setting, n will be the number of training data locations.

Examples

1
2
3
4
5
6
n <- 10
x <- matrix(sort(runif(n)), ncol = 1)
A <- getCorMat(x, rho = 0.6)
x1 <- list(rep(1, n), rep(1,n))
x2 <- list(rep(1, n), MASS::mvrnorm(1, rep(0, n), A))
x1Ainvx2(x1, A, x2)

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