Package: GWlasso 1.0.1
GWlasso: Geographically Weighted Lasso
Performs geographically weighted Lasso regressions. Find optimal bandwidth, fit a geographically weighted lasso or ridge regression, and make predictions. These methods are specially well suited for ecological inferences. Bandwidth selection algorithm is from A. Comber and P. Harris (2018) <doi:10.1007/s10109-018-0280-7>.
Authors:
GWlasso_1.0.1.tar.gz
GWlasso_1.0.1.tar.gz(r-4.5-noble)GWlasso_1.0.1.tar.gz(r-4.4-noble)
GWlasso_1.0.1.tgz(r-4.4-emscripten)GWlasso_1.0.1.tgz(r-4.3-emscripten)
GWlasso.pdf |GWlasso.html✨
GWlasso/json (API)
NEWS
# Install 'GWlasso' in R: |
install.packages('GWlasso', repos = 'https://cloud.r-project.org') |
Bug tracker:https://github.com/nibortolum/gwlasso/issues0 issues
Pkgdown site:https://nibortolum.github.io
- Amesbury - Amesbury Testate Amoebae dataset
Last updated 4 months agofrom:eb81ae9a6a. Checks:3 OK. Indexed: no.
Target | Result | Latest binary |
---|---|---|
Doc / Vignettes | OK | Mar 23 2025 |
R-4.5-linux | OK | Mar 23 2025 |
R-4.4-linux | OK | Mar 23 2025 |
Exports:%>%compute_distance_matrixgwl_bw_estimationgwl_fitplot_gwl_map
Dependencies:bootclassclassIntclicodacodetoolscolorspacecpp11crayonDBIdeldirDEoptimRdplyre1071fansifarverFNNforeachgenericsggplot2ggsideglmnetgluegtableGWmodelhmsintervalsisobanditeratorsKernSmoothlabelinglatticeLearnBayeslifecyclemagrittrMASSMatrixmgcvmultcompmunsellmvtnormnlmepillarpkgconfigprettyunitsprogressproxypurrrR6RColorBrewerRcppRcppArmadilloRcppEigenrlangrobustbases2sandwichscalessfshapespspacetimespatialregspDataspdepstringistringrsurvivalTH.datatibbletidyrtidyselectunitsutf8vctrsviridisLitewithrwkxtszoo
Citation
To cite package ‘GWlasso’ in publications use:
Mulot M, Erb S (2024). GWlasso: Geographically Weighted Lasso. R package version 1.0.1, https://CRAN.R-project.org/package=GWlasso.
Corresponding BibTeX entry:
@Manual{, title = {GWlasso: Geographically Weighted Lasso}, author = {Matthieu Mulot and Sophie Erb}, year = {2024}, note = {R package version 1.0.1}, url = {https://CRAN.R-project.org/package=GWlasso}, }
Readme and manuals
GWlasso
The goal of GWlasso is to provides a set of functions to perform Geographically weighted lasso. It was originally thought to be used in palaeoecological settings but can be used to other extents.
The package has been submitted to CRAN and is awaiting evaluation
Installation
You can install the development version of GWlasso from GitHub with:
# install.packages("devtools")
devtools::install_github("nibortolum/GWlasso")
Example
This is a basic example on how to run a GWlasso pipeline:
library(GWlasso)
## compute a distance matrix from a set of coordinates
distance_matrix <- compute_distance_matrix <- function(coords, method = "euclidean", add.noise = FALSE)
## compute the optimal bandwidth
myst.est <- gwl_bw_estimation(x.var = predictors_df,
y.var = y_vector,
dist.mat = distance_matrix,
adaptive = TRUE,
adptbwd.thresh = 0.1,
kernel = "bisquare",
alpha = 1,
progress = TRUE,
n=40,
nfolds = 5)
## Compute the optimal model
my.gwl.fit <- gwl_fit(myst.est$bw,
x.var = data.sample[,-1],
y.var = data.sample$WTD,
kernel = "bisquare",
dist.mat = distance_matrix,
alpha = 1,
adaptive = TRUE, progress = T)
## make predictions
predicted_values <- predict(my.gwl.fit, newdata = new_data, newcoords = new_coords)
Help Manual
Help page | Topics |
---|---|
Amesbury Testate Amoebae dataset | Amesbury |
Compute distance matrix | compute_distance_matrix |
Bandwidth estimation for Geographically Weighted Lasso | gwl_bw_estimation |
Fit a geographically weighted lasso with the selected bandwidth | gwl_fit |
Plot a map of beta coefficient for gwlfit object | plot_gwl_map |
Plot method for gwlfit object | plot.gwlfit |
Predict method for gwlfit objects | predict.gwlfit |
Printing gwlest objects | print.gwlest |
Printing gwlfit objects | print.gwlfit |