plot_2d_smooth()#
- liesel_gam.plot_2d_smooth(term, samples, newdata=None, ngrid=20, which='mean', quantiles=(0.05, 0.5, 0.95), hdi_prob=0.9, newdata_meshgrid=False)[source]#
Plots a posterior summary for a two-dimensional smooth function.
- Parameters:
term (
StrctInteractionTerm|StrctTensorProdTerm|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. IfNone, a grid will be created internally, using the minimum and maximum observed values of this term’s input covariates. Thengridargument refers to the number of grid elements used in the marginal grids, so the total grid length will bengrid**k, wherekis the number of terms.which (
Literal['mean','sd','var','hdi_low','hdi_high','q_0.05','q_0.5','q_0.95'] |Sequence[Literal['mean','sd','var','hdi_low','hdi_high','q_0.05','q_0.5','q_0.95']], default:'mean') – Which quantities to plot. Can be a list of multiple values.quantiles (
Sequence[float], default:(0.05, 0.5, 0.95)) – Probability levels that should be available for selection inwhich. For example, ifquantiles=0.5, you can selectwhich="q_0.5.hdi_prob (
float, default:0.9) – The probability level at which to include a highest posterior density interval ifwhichcontains"hdi".newdata_meshgrid (
bool, default:False) – If True, then the function will create a large grid of all combinations of covariate values innewdatathat correspond to this term.