inverseEigen: Calculate covariance elements based on eigendecomposition...

Description Usage Arguments Value Examples

Description

inverseEigen calculates the inverse eigendecomposition – in other words, the covariance elements based on the eigenvalues and vectors. For a 2x2 anisotropy (covariance) matrix, we parameterize the three unique values in terms of the two log eigenvalues and a rotation parameter on the rescaled logit. The function is coded as a nimbleFunction (see the nimble package) but can also be used as a regular R function.

Usage

1
inverseEigen(eigen_comp1, eigen_comp2, eigen_comp3, which_Sigma)

Arguments

eigen_comp1

N-vector; contains values of the log of the first anisotropy eigenvalue for a set of locations.

eigen_comp2

N-vector; contains values of the log of the second anisotropy eigenvalue for a set of locations.

eigen_comp3

N-vector; contains values of the rescaled logit of the anisotropy rotation for a set of locations.

which_Sigma

Scalar; one of (1,2,3), corresponding to which covariance component should be calculated (Sigma11, Sigma22, or Sigma12, respectively).

Value

A vector of anisotropy values (Sigma11, Sigma22, or Sigma12; depends on which_Sigma) for the corresponding set of locations.

Examples

1
2
3
4
5
# Generate some eigendecomposition elements (all three are real-valued)
eigen_comp1 <- rnorm(10)
eigen_comp2 <- rnorm(10)
eigen_comp3 <- rnorm(10)
inverseEigen( eigen_comp1, eigen_comp2, eigen_comp3, 2) # Return the Sigma22 values

BayesNSGP documentation built on Jan. 9, 2022, 9:07 a.m.