cor.ct {ctmva}R Documentation

Continuous-time correlation or cross-correlation matrix

Description

Computes the correlation matrix of a continuous-time multivariate data set represented as an fd object; or the cross-correlation matrix of two such data sets.

Usage

cor.ct(fdobj1, fdobj2 = fdobj1, common_trend = FALSE)

Arguments

fdobj1

continuous-time multivariate data set of class "fd"

fdobj2

an optional second data set

common_trend

logical: centering wrt mean function if TRUE, without centering if FALSE (the default)

Value

A matrix of (cross-) correlations

Author(s)

Biplab Paul <paul.biplab497@gmail.com> and Philip Tzvi Reiss <reiss@stat.haifa.ac.il>

See Also

center.fd, for centering of "fd" objects; inprod.cent

Examples


## Not run: 

# Canadian temperature data

require(fda)
require(corrplot)
data(CanadianWeather)
daybasis <- create.fourier.basis(c(0,365), nbasis=55)
tempfd <- smooth.basis(day.5, CanadianWeather$dailyAv[,,"Temperature.C"], daybasis)$fd

## The following yields a matrix of correlations that are all near 1:
rawcor <- cor.ct(tempfd)
corrplot(rawcor, method = 'square', type = 'lower', tl.col="black", tl.cex = 0.6)
## This occurs due to a strong seasonal trend that is common to all stations
## Removing this common trend leads to a more interesting result:
dtcor  <- cor.ct(tempfd, common_trend = TRUE)
ord <- corrMatOrder(dtcor)
dtcord <- dtcor[ord,ord]
corrplot(dtcord, method = 'square', type = 'lower', tl.col="black", tl.cex = 0.6)


## End(Not run)


[Package ctmva version 1.4.0 Index]