plot_1d_smooth()

Contents

plot_1d_smooth()#

liesel_gam.plot_1d_smooth(term, samples, newdata=None, ci_quantiles=(0.05, 0.95), hdi_prob=None, show_n_samples=50, seed=1, ngrid=150)[source]#

Plots a posterior summary for a one-dimensional smooth.

Parameters:
  • term (StrctTerm) – The term to plot.

  • samples (dict[str, Array | ndarray | bool | number | bool | int | float | complex]) – Dictionary of posterior samples. Must contain samples for the term’s coefficient.

  • newdata (Position (dict[str, Any]) | None | Mapping[str, Array | ndarray | bool | number | bool | int | float | complex], default: None) – Optional dictionary of covariate data at which to plot the term. If None, a grid of length ngrid will be created internally, using the minimum and maximum observed values of this term’s input covariate.

  • ci_quantiles (tuple[float, float] | None, default: (0.05, 0.95)) – Which quantiles to use for plotting a credible band.

  • hdi_prob (float | None, default: None) – If not None, the probability level at which to include a highest posterior density interval band in the plot.

  • show_n_samples (int | None, default: 50) – If not None, the number of individual posterior function samples to show.

  • seed (int | Any, default: 1) – Random number seed for random selection of the function samples.

  • ngrid (int, default: 150) – Number of covariate values in the grid used for plotting, if newdata=None.