Skip to content

This function evaluates the causality prediction accuracy across multiple time series within a dataset using the PC Mk. II Light method. It checks the feasibility of causality analysis between all pairs, computes different types of causality (total, positive, negative, dark), and aggregates these results.

Usage

pcAccuracy(dataset, E, tau, metric, h, weighted)

Arguments

dataset

A matrix or data frame where each column represents a time series.

E

The embedding dimension used for state space reconstruction.

tau

The time delay used in state space reconstruction.

metric

A character string specifying the distance metric to be used (e.g., 'euclidean', 'maximum').

h

Prediction horizon, indicating how far ahead in the time series the predictions are aimed.

weighted

A logical indicating whether to use a weighted approach in calculating the causality strengths.

Value

A data frame with the embedding parameters and average values of total, positive, negative, and dark causality across all time series pairs in the dataset.

Examples

# \donttest{
data(climate_indices)
data <- climate_indices[, -1]
results <- pcAccuracy(data, E = 3, tau = 1, metric = "euclidean", h = 1, weighted = TRUE)
print(results)
#>   E tau     total  positive  negative      dark
#> 1 3   1 0.2953271 0.2734389 0.2579996 0.4685615
# }