Expand description
§solow-graphics
Statistical-graphics helpers that compute the data behind a plot and render
it through the solow_viz SVG backend. Every routine returns both the
rendered Figure and the computed arrays, so the numerics can be tested
independently of the (intentionally un-pixel-exact) SVG output.
Provided:
ProbPlot/qqplot— theoretical vs. sample quantiles of a probability plot, plus the fitted reference line (QqLine).plot_acf/plot_pacf— the (biased) autocorrelation and the Yule-Walker partial autocorrelation, with a white-noise confidence band.plot_resid_fitted— a residuals-vs-fitted diagnostic scatter.
use solow_graphics::ProbPlot;
let data = [-1.2, 0.3, 0.1, 1.4, -0.7, 2.1, -0.2, 0.9];
let pp = ProbPlot::new(&data);
assert_eq!(pp.sample_quantiles().len(), data.len());
let line = pp.qqline_regression();
let svg = pp.qqplot().to_svg();
assert!(svg.starts_with("<svg"));
let _ = line.slope;Structs§
- AcfResult
- Result of an autocorrelation/partial-autocorrelation computation.
- Influence
- Per-observation OLS influence diagnostics.
- Mosaic
Data - The normalized geometry behind a
mosaicplot. - Prob
Plot - A normal probability plot (Q-Q plot against the standard normal).
- QqLine
- The fitted reference line of a probability plot,
y = slope * x + intercept, wherexare the theoretical quantiles andythe sample quantiles.
Functions§
- acf
- The biased autocorrelation function for lags
0..=nlags. - conf_
band - The symmetric white-noise confidence half-width
z_{alpha/2} / sqrt(n). - influence_
plot - Render an influence plot: externally studentized residual (y) versus leverage (x), with marker radius scaled by Cook’s distance.
- mosaic
- Render a mosaic plot of a 2-D contingency table
counts(rows × columns). - pacf_yw
- The Yule-Walker partial autocorrelation function (adjusted / unbiased
autocovariances), lags
0..=nlags. - plot_
acf - Compute the ACF and a
(1 - alpha)white-noise confidence band, and render a stem-style plot. Returns theFigureand theAcfResult. - plot_
fit - A
plot_fit-style diagnostic: the observed response and the fitted values plotted against one regressor (columnexog_idxof the design). - plot_
pacf - Compute the (Yule-Walker) PACF and a
(1 - alpha)white-noise confidence band, and render a stem-style plot. Returns theFigureand theAcfResult. - plot_
regress_ exog - A
plot_regress_exog-style 2×2 diagnostic panel against one regressor. - plot_
resid_ fitted - A residuals-vs-fitted diagnostic. Takes the model’s fitted values and
residuals, returns the rendered
Figure(a zero-reference line is drawn atresid = 0). - qqplot
- Convenience wrapper: build a
ProbPlotand render its Q-Q plot.