Pandora-IsoMemo / CausalR

GNU General Public License v3.0
0 stars 0 forks source link

CausalR

last edit: by Jian April 13, 2024

Intall instructions: https://youtu.be/jlT15oblKBE

News: Feb 12:

App 2: Detecting events in time series and assessing impact of events Often we are interested in detecting the timing of an event from the time series data. For instance, the Roman shipwreck example shown previously we see a sharp decline at c. 150 AD. This matches a massive pandemic in the Roman Empire that killed about one third of its population. Conversely, we might be interested in knowing what was the impact of an event like a pandemic or a political decision. The Roman Empire was divided into two parts in the 4th century (East and West) and we would like to know what was the impact of this decision on trade (via the shipwreck proxy). This app will combine two existing R packages: mcp and CausalImpact mcp takes a Bayesian approach to point changes. It can detect changes in time series trends following different link functions, it can detect changes in variances, and point change estimates are given as distributions (see example below)

image

The implementation of mcp within the app should follow options given at this website: https://lindeloev.github.io/mcp/index.html Currently a mcp user has to select a number of functions and their type and point changes. In the example above, we have 3 linear functions and 2 point changes. Different options on these can be compared using leave-one-out cross-validation (loo) implemented within the app. Something to be added is an option where user can select a maximum number of functions, potential function types, max number of change points. A programming cycle is run for all combinations of these (up to max numbers) and their loo calculated. The output will rank models. The implementation of CausalImpact should follow this vignette: https://google.github.io/CausalImpact/CausalImpact.html One can quantify the impact of a certain event (e.g., political decision) at a known time under a counterfactual Bayesian approach. This requires the time series that one is interested in (e.g., number of written documents, shipwrecks) and independent time series for comparison. Illustration below.

image

The above shows the impact of event at time 70. The blue broad line after is the predicted time series and the think dark line is the actual data. The impact is the difference.