het_breuschpagan

In [ ]:
het_breuschpagan(vdf: vDataFrame, 
                 eps: str, 
                 X: list)

Breusch-Pagan test for heteroscedasticity.

Parameters

Name Type Optional Description
vdf
vDataFrame
❌
input vDataFrame.
eps
str
❌
Input residual vcolumn.
X
list
❌
Exogenous Variables to test the heteroscedasticity on.

Returns

tablesample : An object containing the result. For more information, see utilities.tablesample.

Example

In [9]:
from verticapy import *
texas = vDataFrame("Texas")
texas.plot(ts = "date", columns = ["cases", "deaths"])
Out[9]:
<AxesSubplot:xlabel='"date"'>
In [10]:
from verticapy.learn.linear_model import LinearRegression

model = LinearRegression("Texas_deaths_lr")
model.drop()
model.fit(texas, X = ["cases"], y = "deaths")
texas = model.predict(texas, name = "deaths_pred")
texas["eps"] = texas["deaths"] - texas["deaths_pred"]
In [11]:
from verticapy.stats import het_breuschpagan
het_breuschpagan(texas, 
                 eps = "eps", 
                 X = ["cases"])
Out[11]:
value
Lagrange Multiplier Statistic2.0452954249167528
lm_p_value0.1526773429034763
F Value2.0463732312545195
f_p_value0.15619270332930216
Rows: 1-4 | Columns: 2