bayespecon.diagnostics.bayesian_lmtests.BayesianLMTestResult

class bayespecon.diagnostics.bayesian_lmtests.BayesianLMTestResult(lm_samples, mean, median, credible_interval, bayes_pvalue, test_type, df=1, details=None)[source]

Container for Bayesian LM test results.

lm_samples[source]

Posterior samples of the LM statistic.

Type:

np.ndarray

mean[source]

Posterior mean of the LM statistic.

Type:

float

median[source]

Posterior median of the LM statistic.

Type:

float

credible_interval[source]

95% credible interval for the LM statistic.

Type:

Tuple[float, float]

bayes_pvalue[source]

P-value computed at the posterior mean of the LM statistic, 1 - chi2.cdf(mean, df). Under H₀ the LM statistic follows a \(\chi^2\) distribution ([Doğan et al., 2021], Proposition 1).

Type:

float

test_type[source]

Label identifying the test (e.g. "bayesian_lm_lag").

Type:

str

df[source]

Degrees of freedom for the reference \(\chi^2\) distribution. Default is 1 for single-parameter tests.

Type:

int

details[source]

Additional metadata (e.g. number of posterior draws).

Type:

Dict[str, Any]

__init__(lm_samples, mean, median, credible_interval, bayes_pvalue, test_type, df=1, details=None)[source]

Methods

__init__(lm_samples, mean, median, ...[, ...])

to_dict()

Convert the test result to a dictionary.

to_series()

Convert the test result to a pandas Series.

Attributes

details

df

lm_samples

mean

median

credible_interval

bayes_pvalue

test_type

bayes_pvalue[source]
credible_interval[source]
details = None[source]
df = 1[source]
lm_samples[source]
mean[source]
median[source]
test_type[source]
to_dict()[source]

Convert the test result to a dictionary.

to_series()[source]

Convert the test result to a pandas Series.