est_cov: Empirical covariance function

View source: R/Covariance_fn.R

est_covR Documentation

Empirical covariance function

Description

Computes the empirical covariance function of a process, for each pair of time points in the time sequence using M realisations of the process.

Usage

est_cov(X, theta = 0.1, plot = FALSE)

Arguments

X

A data frame where the first column is the numeric time sequence and the remaining columns are the values of each realisation of the process.

theta

Smoothing parameter.

plot

Logical: If TRUE, a 3D surface plot of the covariance function is plotted in interactive sessions.

Details

The smoothing parameter theta can help to better visualise changes between neighbour estimated values.

Value

An m \times m matrix, where m is the number of time points. Each element represents the estimated value of covariance function for the corresponding time points. Time points are arranged in ascending order.

See Also

cov_GHBMP

Examples


#Matrix of empirical covariance estimates of the GHBMP with Hurst function H.
t <- seq(0, 1, by = (1/2)^8)
H <- function(t) {return(0.5 - 0.4 * sin(6 * 3.14 * t))}
#Only 5 realisations of GHBMP are used in this example to reduce the computational time.
X.t <- replicate(5, GHBMP(t, H), simplify = FALSE)
X <- do.call(rbind, lapply(X.t, function(df) df[, 2]))
Data <- data.frame(t, t(X))
cov.mat <- est_cov(Data, theta = 0.2, plot = TRUE)
cov.mat


Rmfrac documentation built on Sept. 10, 2025, 10:31 a.m.