View source: R/temporal_weights.R
temporal_autocor | R Documentation |
This function computes the temporal autocorrelation of a given matrix using a specified window size and optionally inverts the correlation matrix.
temporal_autocor(X, window = 3, inverse = FALSE)
X |
A numeric matrix for which to compute the temporal autocorrelation |
window |
integer, the window size for computing the autocorrelation, must be between 1 and ncol(X) (default is 3) |
inverse |
logical, whether to compute the inverse of the correlation matrix (default is FALSE) |
A sparse symmetric matrix representing the computed temporal autocorrelation
# Create an example matrix
X <- matrix(rnorm(50), nrow = 10, ncol = 5)
# Compute the temporal autocorrelation
result <- temporal_autocor(X, window = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.