mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-11-14 13:21:05 +00:00
* fix(docs): added margin between sections * feat: removed unused files; updated ga * fix: juan stuff doesnt work * fix: random fix * moon at noon * fix: update docusaurus config * Update controller_doc_classes.py * fix: temp fix * fix: temp fix * Update controller_doc_classes.py * fix: remove old content * fix: taggfix * init * fix: styling and moved file * Update generate_terminal_markdown.py * fix: removed unused images * fix: port new files * Update generate_sdk_markdown.py * Update controller_doc_classes.py Co-authored-by: teh_coderer <me@tehcoderer.com>
2.1 KiB
Vendored
2.1 KiB
Vendored
title, description
| title | description |
|---|---|
| dwat | OpenBB SDK Function |
import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem';
dwat
Calculate test statistics for Durbin Watson autocorrelation
Source Code: [link]
openbb.econometrics.dwat(model: statsmodels.regression.linear_model.RegressionResultsWrapper)
Parameters
| Name | Type | Description | Default | Optional |
|---|---|---|---|---|
| model | statsmodels.regression.linear_model.RegressionResultsWrapper | Previously fit statsmodels OLS. | None | False |
Returns
| Type | Description |
|---|---|
| float | Test statistic of the Durbin Watson test. |
Examples
SDK Snippet:
from openbb_terminal.sdk import openbb
df = openbb.econometrics.load("wage_panel")
Y, X = df["lwage"], df[["exper","educ"]]
model = openbb.econometrics.ols(Y,X)
durbin_watson_value = openbb.econometrics.dwat(model)
Result:
0.96
Show Durbin-Watson autocorrelation tests
Source Code: [link]
openbb.econometrics.dwat_chart(model: statsmodels.regression.linear_model.RegressionResultsWrapper, dependent_variable: pd.Series, plot: bool = True, export: str = "", external_axes: Optional[List[axes]] = None)
Parameters
| Name | Type | Description | Default | Optional |
|---|---|---|---|---|
| model | OLS Model | A fit statsmodels OLS model. | None | False |
| dependent_variable | pd.Series | The dependent variable for plotting | None | False |
| plot | bool | Whether to plot the residuals | True | True |
| export | str | Format to export data | True | |
| external_axes | Optional[List[plt.axes]] | External axes to plot on | None | True |
Returns
This function does not return anything