Earlier this evening I wrapped up the source tarball for version 0.10.0 of gratia
and submitted it to CRAN. Following automated check's, this new version of
gratia is now available from CRAN 🥳
This is a small release of gratia to coincide with the final stages of the review
process of a Journal of Open Source Software paper on gratia that I submitted
earlier in the year. Apart from a slew of bug fixes, the main new feature in this
release is conditional_values()
, a tidy/ggplot version of mgcv::vis.gam()
that
is based on marginaleffects plot_predictions()
. conditional_values()
is
intended as a user friendly way to visualise predicted values of the model that
are conditional on supplied values of covariates. For more complex GAMs, such
visualisations are an essential way to understand and interpret the fitted model.
New features
-
conditional_values()
and itsdraw()
method compute and plot predictions
from a fitted GAM that are conditional on one or more covariates. The
function is a wrapper aroundfitted_values()
but allows the user simple ways
to specify which covariates to condition on and at what values those
covariates should take. It provides similar functionality to
marginaleffects::plot_predictions()
, but is simpler. See #300. -
penalty()
andbasis()
can now allow the smooth to be reparameterized such
that the resulting basis has an identity matrix. This more clearly highlights
the penalty null space, the functions that the penalty has no effect on. -
draw.gam()
anddraw.smooth_estimates()
gain argumentcaption
, which, if
set toFALSE
will not plot the smooth basis type as a caption on the plot.
#307 -
appraise()
andqq_plot.gam()
now allow the user to set a random seed that
is used when generating reference quantiles withmethod = "uniform"
or
method = "simulate"
.
Bug fixes
-
derivative_samples()
was ignoring thescale
argument. #293 Reported by
@jonathonmellor -
Argument
level
toderivative_samples()
was included accidentally. As of
v0.9.2.9002 this argument is deprecated and using it will now generate a
warning. #291 -
draw()
was not plotting cyclic P spline smooths. Reported by @Zuckerbrot
#297 -
derivatives()
would fail for"fs"
smooths with other parametric effects in
the model. Reported by @mahonmb #301 -
Partial residuals in
partial_residuals()
anddraw.gam()
were wrong for
GAMs fitted withfamily = binomial()
where theweights
argument contained
the binomial sample sizes because the prior weights were being used to form
weighted working residuals. Now working weights are used instead. Reported by
@emchuron #273 -
Internal function
gammals_link()
was expecting"theta"
as a synonym for
the scale parameter but the master table has"phi"
coded as the synonym.
Now both work as expected. -
level()
assumed thatlevel
would have only a single value even though it
could handle multiple levels. #321