mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-11-09 02:42:36 +00:00
* Update generate_terminal_markdown.py * updates * update workflows * Automated Change * tests * tests * Automated Change * Update test_generate_docs.py * Automated Change * updates * Automated Change * Update gen-docs.yml * Update test.yml * Automated Change * Update test.yml * Automated Change * Update generate_sdk_markdown.py * Automated Change * test * Automated Change * testtt23 * Automated Change * Update generate_sdk_markdown.py * Automated Change * Automated Change * added empting reference folders before autogen docs * updates * Automated Change * update tests gitactions * Automated Change * up * Automated Change * Automated Change * update pytest * Automated Change * tests * Automated Change * examples update * Automated Change * Update generate_sdk_markdown.py * Automated Change * Update test.yml * Update generate_sdk_markdown.py * strip * Automated Change * Workflow : check test update * Automated Change * Automated Change * Automated Change * Update test.yml * Automated Change * Update test.yml * Automated Change * Automated Change * up * Automated Change * Update generate_sdk_markdown.py * Automated Change * update workflows * fix guides * testing * Update gh-pages.yml * Update gh-pages.yml Co-authored-by: tehcoderer <tehcoderer@users.noreply.github.com> Co-authored-by: Jeroen Bouma <jer.bouma@gmail.com> Co-authored-by: Chavithra PARANA <chavithra@gmail.com> Co-authored-by: Chavithra <Chavithra@users.noreply.github.com> Co-authored-by: jose-donato <43375532+jose-donato@users.noreply.github.com> Co-authored-by: jose-donato <jose-donato@users.noreply.github.com>
52 lines
2.1 KiB
Markdown
Vendored
52 lines
2.1 KiB
Markdown
Vendored
---
|
|
title: granger
|
|
description: OpenBB Terminal Function
|
|
---
|
|
|
|
# granger
|
|
|
|
Show Granger causality between two timeseries
|
|
|
|
### Usage
|
|
|
|
```python
|
|
granger [-t Available time series] [-l LAGS] [-c CONFIDENCE]
|
|
```
|
|
|
|
---
|
|
|
|
## Parameters
|
|
|
|
| Name | Description | Default | Optional | Choices |
|
|
| ---- | ----------- | ------- | -------- | ------- |
|
|
| ts | Requires two time series, the first time series is assumed to be Granger-caused by the second time series. | None | True | None |
|
|
| lags | How many lags should be included | 3 | True | None |
|
|
| confidence | Set the confidence level | 0.05 | True | None |
|
|
|
|
|
|
---
|
|
|
|
## Examples
|
|
|
|
```python
|
|
2022 Jun 01, 06:35 (🦋) /econometrics/ $ load strikes
|
|
|
|
2022 Jun 01, 06:36 (🦋) /econometrics/ $ granger strikes.duration,strikes.iprod
|
|
|
|
Granger Causality Test [Y: strikes.duration | X: strikes.iprod | Lags: 3]
|
|
┏━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━┳━━━━━━━┳━━━━━━┓
|
|
┃ ┃ F-test ┃ P-value ┃ Count ┃ Lags ┃
|
|
┡━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━╇━━━━━━━╇━━━━━━┩
|
|
│ ssr_ftest │ 0.81 │ 0.49 │ 52.00 │ 3.00 │
|
|
├──────────────┼────────┼─────────┼───────┼──────┤
|
|
│ ssr_chi2test │ 2.75 │ 0.43 │ - │ 3 │
|
|
├──────────────┼────────┼─────────┼───────┼──────┤
|
|
│ lrtest │ 2.69 │ 0.44 │ - │ 3 │
|
|
├──────────────┼────────┼─────────┼───────┼──────┤
|
|
│ params_ftest │ 0.81 │ 0.49 │ 52.00 │ 3.00 │
|
|
└──────────────┴────────┴─────────┴───────┴──────┘
|
|
|
|
As the p-value of the F-test is 0.495, we can not reject the null hypothesis at the 0.05 confidence level.
|
|
```
|
|
---
|