plotPath: Plot of the regularisation path of a 'ppmlasso' model

View source: R/ppmlasso/R/ppmlasso_functions.R View source: R/ppmlasso_functions.R

plotPathR Documentation

Plot of the regularisation path of a ppmlasso model

Description

This function produces a trace plot of the coefficient estimates of a fitted ppmlasso object and identifies the models which optimise the various penalisation criteria.

Usage

plotPath(fit, colors = c("gold", "green3", "blue", "brown", "pink"), logX = TRUE)

Arguments

fit

A fitted ppmlasso object.

colors

A vector of colours for each criterion: "aic", "bic", "hqc", "gcv", and "nlgcv".

logX

A logical argument to indicate whether the plot should utilise a logarithmic scale on the x-axis (the default) or not.

Details

A fitted ppmlasso object contains a matrix called betas which stores the coefficient estimates of each of the n.fits models fitted. This function produces a traceplot of these coefficient estimates for each environmental variable and highlights the models which optimise each of the penalisation criteria.

Author(s)

Ian W. Renner

Examples

data(BlueMountains)
sub.env = BlueMountains$env[BlueMountains$env$Y > 6270 & BlueMountains$env$X > 300,]
sub.euc = BlueMountains$eucalypt[BlueMountains$eucalypt$Y > 6270 & BlueMountains$eucalypt$X > 300,]
ppm.form = ~poly(FC, TMP_MIN, TMP_MAX, RAIN_ANN, degree = 2) + poly(D_MAIN_RDS, D_URBAN, degree = 2)
ppm.fit  = ppmlasso(ppm.form, sp.xy = sub.euc, env.grid = sub.env, sp.scale = 1, n.fits = 20,
writefile = FALSE)
plotPath(ppm.fit)

ppmlasso documentation built on May 29, 2024, 7:12 a.m.