mlegp-svd-functions {mlegp} | R Documentation |
Functions that deal with the singular value decomposition of an output Y, for use with Gaussian process lists
pcweights(Y, weights.num = NULL, cutoff = 99)
getSingularValues(Y)
singularValueImportance(Y)
numSingularValues(Y, cutoff = 99)
Y |
the output to decompose, where each column of |
weights.num |
optionally, the number of principle component weights to keep |
cutoff |
if specified, |
Utilizes the singular value decomposition (SVD) of Y
, Y = UDVprime. Columns of Y
should correspond to a single k-dimensional observation (e.g., functional output of a computer model, evaluated at a particular input).
For a k x m matrix Y
, and r = min(k,m), in the complete SVD, U
is k x r, D
is r x r, containing the singular values along the diagonal, and Vprime
is r x m. The output Y
is approximated by keeping l < r singular values, keeping a UD matrix of dimension k x l, and the Vprime
matrix of dimension l x m. Each column of Vprime
now contains l principle component weights, which can be used to reconstruct the functional output.
pcweights
returns a list with components:
UD |
the UD matrix corresponding to the number of principle components kept |
Vprime |
The Vprime matrix corresponding to the number of principle components kept |
Note: the number of principle component weights kept is equal to dim(UD)[2]
getSingularValues
returns a matrix containing the singular values of Y
numSingularValues
returns the minimum number of singular values accounting for cutoff
percent of the variation in Y
singularValueImportance
returns a matrix where element i corresponds to the percentage of total variation in Y
accounted for by the first i singular values
these functions are utilized by mlegp
to fit Gaussian processes to principle component weights
Garrett M. Dancik dancikg@easternct.edu
Heitmann, K., Higdon, D., Nakhleh, C., Habib, S., 2006. Cosmic Calibration. The Astrophysical Journal, 646, 2, L1-L4.
https://github.com/gdancik/mlegp/
## create functional output that varies based on parameter 'p' ##
x = seq(-5,5,by=.2)
p = 1:50
y = matrix(0,length(p), length(x))
for (i in p) {
y[i,] = sin(x) + i + rnorm(length(x), sd = .1)
}
singularValueImportance(t(y))
numSingularValues(t(y), cutoff = 99.99)