cor.fts: Correlation for Functional Time Series Objects

View source: R/ftscor.R

cor.ftsR Documentation

Correlation for Functional Time Series Objects

Description

This function finds the correlation between univariate or multivariate functional time series (fts) objects.

Usage

cor.fts(Y1, Y2)

Arguments

Y1

An object of class fts.

Y2

An object of class fts.

Value

A scalar that is the correlation between fts objects.

See Also

fts

Examples

## Not run: 
require(Rfssa)
load_github_data("https://github.com/haghbinh/Rfssa/blob/master/data/Jambi.RData")
## Raw image data
NDVI <- Jambi$NDVI
EVI <- Jambi$EVI
## Kernel density estimation of pixel intensity
D0_NDVI <- matrix(NA, nrow = 512, ncol = 448)
D0_EVI <- matrix(NA, nrow = 512, ncol = 448)
for (i in 1:448) {
  D0_NDVI[, i] <- density(NDVI[, , i], from = 0, to = 1)$y
  D0_EVI[, i] <- density(EVI[, , i], from = 0, to = 1)$y
}
d <- 11
u <- seq(0, 1, length.out = 512)
Y_1 <- Rfssa::fts(list(D0_NDVI), list(list(d, "bspline")), list(u))
Y_2 <- Rfssa::fts(list(D0_EVI), list(list(d, "bspline")), list(u))
out <- cor.fts(Y_1, Y_2)
print(out)

## End(Not run)


Rfssa documentation built on Sept. 9, 2022, 1:07 a.m.