ergmx.McmcDiagnostics#

class ergmx.McmcDiagnostics(names, sample, observed, interval=None)[source]#

Diagnostics of the MCMC sample of the last Monte Carlo MLE iteration.

The sample is of the model statistics, as deviations from the observed statistics: at the MLE, their mean should be zero. As in ergm, it was drawn at the coefficients before the final update, which corrects for the mean deviations. Print it for the tables, or call plot() for trace and density plots.

names#

Names of the statistics.

deviations#

Sampled statistics minus the observed ones (chains x samples x statistics).

interval#

MCMC proposals between two samples.

property n_samples#

Samples per chain.

property autocorrelation_time#

Integrated autocorrelation time, in samples (1 for independent samples).

property naive_se#

Standard error of the mean if the samples were independent.

property timeseries_se#

Standard error of the mean, accounting for autocorrelation.

property rhat#

about 1 when the chains agree; above 1.01 to 1.1 suggests they have not mixed.

Type:

Split R-hat (Gelman et al. 2013)

property geweke#

the mean of the first 10% of each chain against the last 50%, as in R’s coda.

Type:

Geweke z-scores (chains x statistics)

property pvalue#

Hotelling’s T^2 test that the mean deviations are zero, with the effective sample size.

plot()[source]#

Trace and density of each statistic, one line per chain, like R’s mcmc.diagnostics() plots. Needs matplotlib. Returns the figure.