Skip to content

Commit

Permalink
update pkgdown and dynamic vigntte
Browse files Browse the repository at this point in the history
  • Loading branch information
wanghui5801 committed Dec 16, 2024
1 parent e8686ce commit bb3dbdc
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 9 deletions.
42 changes: 41 additions & 1 deletion _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,45 @@ template:
bootstrap: 5
package: tidytemplate

navbar:
structure:
left: [ "index.html", "articles", "reference" ]
right: [ "github.com" ]

development:
mode: auto
mode: auto

reference:
- title: "Core Functions"
desc: "Functions for pattern causality analysis"
contents:
- starts_with("pc")
- title: "Utility Functions"
desc: "Helper functions for data processing and visualization"
contents:
- starts_with("plot")
- starts_with("optimal")
- starts_with("pcCross")
- starts_with("pcEffect")

articles:
- title: "Introduction"
desc: "An overview of pattern causality"
contents:
- "patterncausality.html"
- title: "Time Series Analysis"
desc: "Causality analysis between two series"
contents:
- "series.html"
- title: "Advanced Analysis"
desc: "Custom functions for tailored analysis"
contents:
- "advanced.html"
- title: "Dynamic Analysis"
desc: "Pattern causality in time points"
contents:
- "dynamic.html"
- title: "Multivariate Analysis"
desc: "System-wide interactions"
contents:
- "matrix.html"
9 changes: 1 addition & 8 deletions vignettes/dynamic.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,11 @@ knitr::opts_chunk$set(
)
```

## Introduction

As it's hard to understand the pattern causality algorithm based on chaos theory, some researchers always wonder if this algorithm is able to capture the dynamic causality between series.

In this vignette, we will demonstrate how to use the `patterncausality` package to analyze the dynamic causality between two series.

## Loading the Package and Data

First of all, we need to load the package and the dataset as usual.

Expand All @@ -33,7 +31,7 @@ data(climate_indices)

Here we choose the typical climate dataset to show the dynamic analysis. We can easily get the pattern causality result by `pcLightweight` function to give a quick view, generally speaking, this result is obtained by the whole time points.

## Quick View of Pattern Causality
## Causality Strength Analysis with Erf Function

```{r}
X <- climate_indices$AO
Expand All @@ -43,8 +41,6 @@ result <- pcLightweight(X, Y, E = 3, tau = 1, metric = "euclidean", h = 1, weigh

The parameter `weighted` decides if we need to calculate the causality strength by erf function, we can show this kind of strength here in each time point.

## Detailed Causality Analysis

To get the causality strength in each time point, we need the recorded function `pcFullDetails` to give causality strength details.

```{r}
Expand All @@ -54,7 +50,6 @@ print(result)

The summary of the result is shown, all the related data has been saved in the `result` object, then we can plot the causality strength series from this, as we said in the previous work, the each time point if and only if the causality is one of the three types, so the each time point just has one causality.

## Plotting Causality Strength

```{r}
plot_causality(result, type="total")
Expand All @@ -79,8 +74,6 @@ print(result)

Obviously, the number of total causality points is the same, then we also provide the plot function for this situation to find more details about the dynamic causality.

## Plotting Raw Causality Strength

```{r}
plot_causality(result, type="total")
```
Expand Down

0 comments on commit bb3dbdc

Please sign in to comment.