# GamCheckResult


Container returned by [GAM.gam_check()](GAM.md#whittaker.GAM.gam_check), bundling residual diagnostics with fit summary


Usage

``` python
GamCheckResult(
    deviance_residuals,
    fitted_values,
    response,
    k_check,
    deviance_explained,
    scale,
    edf_total,
    n_obs,
)
```


statistics and basis-dimension adequacy checks.

This mirrors the console output of R mgcv's `gam.check()`: it lets you inspect whether the residuals look well-behaved and whether any smooth's basis dimension `k` was set too small (in which case the smooth may be under-fitting), all from a single object. Printing the result (or relying on its `__repr__`) gives a compact textual report; the individual attributes are also available for building custom diagnostic plots (see `GAM.check()`).


## Attributes


`deviance_residuals: numpy.ndarray`  
Deviance residuals, shape `(n,)`. Should look approximately normal and homoscedastic for a well-specified model.

`fitted_values: numpy.ndarray`  
Fitted values `mu` on the response scale, shape `(n,)`.

`response: numpy.ndarray`  
Observed response values `y` used for fitting, shape `(n,)`.

`k_check: list[KCheckResult]`  
One basis-dimension check per smooth term. Each entry reports a k-index and a simulation-based p-value; low p-values (typically flagged with `*`) suggest the smooth's basis dimension `k` may be too small to capture the true function.

`deviance_explained: float`  
Proportion of null deviance explained by the model, in `[0, 1]` (analogous to R-squared for non-Gaussian families).

`scale: float`  
The estimated scale (dispersion) parameter `phi`.

`edf_total: float`  
The total effective degrees of freedom across all model terms.

`n_obs: int`  
The number of observations used in the fit.
