View source: R/ppmlasso_functions.R

findRes | R Documentation |

This function produces a plot to choose the optimal spatial resolution for analysis. A point process model is calculated for each nominated spatial resolution and the log-likelihood of all fitted models are plotted against the spatial resolutions.

findRes(scales, lambda = 0, coord = c("X", "Y"), sp.xy, env.grid, formula, tol = 0.01, ...)

`scales` |
A vector of spatial resolutions for which to produce the plot. |

`lambda` |
The penalty for each fitted spatial resolution. This should be a single value such that only one point process model is computed for each spatial resolution. |

`coord` |
A vector containing the names of the longitude and latitude coordinates,
used by |

`sp.xy` |
A matrix of species locations containing at least one column representing
longitude and one column representing latitude, as in |

`env.grid` |
The geo-referenced matrix of environmental grids, as in |

`formula` |
The formula of the fitted model, as in |

`tol` |
An optional argument to specify the tolerance level of coordinate error passed to an internal call to the |

`...` |
Further arguments passed to |

This function produces a plot which can be used to judge an optimal spatial resolution for analysis. As the spatial resolution gets finer, the log-likelihood tends to stabilise to a constant value. The largest spatial resolution at which the log-likelihood appears to stabilise may be considered optimal for model fitting.

A plot of log-likelihood versus spatial resolution.

Ian W. Renner

Renner, I.W. et al (2015). Point process models for presence-only analysis. *Methods in Ecology and Evolution* **6**, 366-379.

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,] scales = c(0.5, 1, 2, 4, 8, 16) ppm.form = ~ poly(FC, TMP_MIN, TMP_MAX, RAIN_ANN, degree = 2) findRes(scales, formula = ppm.form, sp.xy = sub.euc, env.grid = sub.env)

ppmlasso documentation built on Dec. 1, 2022, 5:09 p.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.