Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

fwcor

Weighted Correlation Matrix


Description

This function returns the weighted correlation (w-correlation) matrix for functional time series (fts) objects that were reconstructed from functional singular spectrum analysis (fssa) objects.

Usage

fwcor(U, group)

Arguments

U

an object of class fssa

group

a list or vector of indices which determines the grouping used for the reconstruction in pairwise w-correlations matrix

Value

a square matrix of w-correlation values for the reconstructed fts objects that were built from fssa components

See Also

Examples

## Not run: 

## Univariate W-Correlation Example on Callcenter data
data("Callcenter")
require(fda)
require(Rfssa)
## Define functional objects
D <- matrix(sqrt(Callcenter$calls),nrow = 240)
N <- ncol(D)
time <- 1:N
K <- nrow(D)
u <- seq(0,K,length.out =K)
d <- 22 #Optimal Number of basis elements
basis <- create.bspline.basis(c(min(u),max(u)),d)
Ysmooth <- smooth.basis(u,D,basis)
## Define functional time series
Y <- fts(Ysmooth$fd)
## Decomposition stage of univariate functional singular spectrum analysis
L <- 28
U <- fssa(Y,L)
ufwcor=fwcor(U = U,group = list(1,2,3))
wplot(W=ufwcor)

## Multivariate W-Correlation Example on Bivariate Satelite Image Data
require(fda)
require(Rfssa)
## 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
}
## Define functional objects
d <- 11
basis <- create.bspline.basis(c(0,1),d)
u <- seq(0,1,length.out = 512)
y_NDVI <- smooth.basis(u,as.matrix(D0_NDVI),basis)$fd
y_EVI <- smooth.basis(u,as.matrix(D0_EVI),basis)$fd
y=list(y_NDVI,y_EVI)
## Define functional time series
Y=fts(y)
plot(Y)
L=45
## Decomposition stage of multivariate functional singular spectrum analysis
U=fssa(Y,L)
mfwcor=fwcor(U = U,group = list(1,2,3,4))
wplot(W=mfwcor)

## End(Not run)

Rfssa

Functional Singular Spectrum Analysis

v1.0.0
GPL (>= 2)
Authors
Hossein Haghbin [aut, cre], Seyed Morteza Najibi [aut], Jordan Trinka [aut], Mehdi Maadooliat [aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.