ppmlasso-package | R Documentation |
This package contains tools to fit point process models with sequences of LASSO penalties ("regularisation paths"). Regularisation paths of Poisson point process models or area-interaction models can be fitted with LASSO, adaptive LASSO or elastic net penalties. A number of criteria are available to judge the bias-variance tradeoff.
The key functions in ppmlasso are as follows:
Useful pre-analysis functions:
findRes
Determine the optimal spatial resolution at which to perform analysis
getEnvVar
Interpolate environmental data to species presence locations
griddify
Ensure a matrix of environmental data is on a rectangular grid
ppmdat
Calculate observation weights and set up design matrix for fitting
pointInteractions
Calculate interpoint interactions for fitting area-interaction models
sampleQuad
Set up a regular grid of quadrature points
Creating regularisation paths of point process models:
ppmlasso
Fit a regularisation path of point process models
plotFit
Plot the fitted intensity of a ppmlasso
object
plotPath
Plot the regularisation path of a ppmlasso
object
print.ppmlasso
Print output from a ppmlasso
object
predict.ppmlasso
Make predictions from a fitted point process model to new data
Checking assumptions:
diagnose.ppmlasso
Create diagnostic residual plots of ppmlasso
object
envelope.ppmlasso
Create simulation envelope for goodness-of-fit checks on a ppmlasso
object
Ian W. Renner
Maintainer: Ian W. Renner <Ian.Renner@newcastle.edu.au>
Renner, I.W. & Warton, D.I. (2013). Equivalence of MAXENT and Poisson point process models for species distribution modeling in ecology Biometrics 69, 274-281.
Renner, I.W. et al (2015). Point process models for presence-only analysis. Methods in Ecology and Evolution 6, 366-379.
Renner, I.W., Warton, D.I., & Hui, F.K.C. (2021). What is the effective sample size of a spatial point process? Australian & New Zealand Journal of Statistics 63, 144-158.
# Fit a regularisation path of Poisson point process models
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, raw = TRUE)
ppm.fit = ppmlasso(ppm.form, sp.xy = sub.euc, env.grid = sub.env, sp.scale = 1, n.fits = 20,
writefile = FALSE)
# Fit a regularisation path of area-interaction models
data(BlueMountains)
ai.form = ~ poly(FC, TMP_MIN, TMP_MAX, RAIN_ANN, degree = 2, raw = TRUE)
ai.fit = ppmlasso(ai.form, sp.xy = sub.euc, env.grid = sub.env, sp.scale = 1,
family = "area.inter", r = 2, availability = BlueMountains$availability, n.fits = 20,
writefile = FALSE)
# Print a ppmlasso object
print(ppm.fit, out = "model")
# Residual plot of a ppmlasso object
diagnose(ppm.fit, which = "smooth", type = "Pearson")
# Make predictions
pred.mu = predict(ppm.fit, newdata = sub.env)
# Plot the intensity from a fitted ppmlasso object
plotFit(ppm.fit)
# Plot the regularisation path from a fitted ppmlasso object
plotPath(ppm.fit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.