Learn R Programming

patterncausality (version 0.1.3)

pcAccuracy: PC Accuracy Evaluation Function

Description

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)

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.

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.

Examples

Run this code
# \donttest{
data(climate_indices)
data <- climate_indices[, -1]
results <- pcAccuracy(data, E = 3, tau = 1, metric = "euclidean", h = 1, weighted = TRUE)
print(results)
# }

Run the code above in your browser using DataLab