Geometric goodness of fit

Description

The spatgeom package provides goodness-of-fit tests for spatial point process models. The spatgeom package provides the implementation to perform the geometric spatial point analysis developed in Hernández & Solís (2022) doi:10.1007/s00180-022-01244-1. It estimates the geometric goodness-of-fit index for a set of variables against a response one based on the 'sf' package. The package has methods to print and plot the results.

Installation

The package is currently available on CRAN and can be installed using:

install.packages("spatgeom")

and loaded using the following command:

library(spatgeom)

Usage

Estimating the geometric goodness-of-fit index

The package has one main function spatgeom that takes as input a set of variables and a response one.

For example, this is how you can use the package to estimate the geometric goodness-of-fit index with a set of variables in a donut shape against a response one:

 xy <- donut_data(n = 100, a = -1, b = 1, theta = 2 * pi)
 estimation <- spatgeom(y = xy[, 1], x = xy[, -1])

The package allow to estimate the envelope of the curve using the parameter envelope=TRUE:

 estimation <- spatgeom(y = xy[, 1], x = xy[, -1], envelope = TRUE)

In the example, the estimation object is a list of class spatgeom with the following elements:

Printing and plotting the results

The package has a print method for objects of class spatgeom:

print(estimation)

and a plot method for objects of class spatgeom. The plot method has two options: curve and deriv. The curve option plots the curve of of the goodness-of-fit index. The deriv option plots the numerical derivative.

plot_curve(estimation, type = "curve")
plot_curve(estimation, type = "deriv")

Citation

If you use the spatgeom package in your work, please cite the following paper:

License

This package is free and open source software, licensed under MIT License. See the LICENSE file for details.