varycoef
The R package varycoef implements Gaussian processes spatially varying coefficient models.
Science Score: 13.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
○codemeta.json file
-
○.zenodo.json file
-
✓DOI references
Found 8 DOI reference(s) in README -
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (17.2%) to scientific vocabulary
Keywords
Repository
The R package varycoef implements Gaussian processes spatially varying coefficient models.
Basic Info
Statistics
- Stars: 13
- Watchers: 1
- Forks: 3
- Open Issues: 4
- Releases: 0
Topics
Metadata Files
README.md

varycoef: An R Package to Model Spatially Varying Coefficients using Gaussian Processes
About
The R package varycoef is the software implementation of Gaussian process-based spatially varying coefficient models by Dambon et al. (2021a). It extends linear regression models such that the coefficients are depending on some coordinates in a d dimensional space, i.e., the coefficient b_j for a covariate j is depending on coordinates s and therefore of the form b_j(s). These coefficients are modeled using Gaussian processes. In most applications, the coordinates s tend to be observation locations like longitude and latitude (see Dambon et al. (2022) as an example). However, the concept can be extended in the number of dimensions or, say, using observation time points to model time-varying coefficients.
The method relies on maximum likelihood estimation. It has been optimized to work with large data sets by applying covariance tapering by Furrer et al. (2006) if necessary and allows for a moderate number of spatially varying coefficients. The R package contains methods to estimate Gaussian process-based (spatially) varying coefficient models, (spatially) predict coefficients as well as the response, and variable selection methods. Latter are based on Dambon et al. (2021b).
Getting Started
To install it, run
devtools::install_github("jakobdambon/varycoef")
for the latest version on this repository or download it from CRAN.
Model Assumptions
Note: The exact definition of the model is given in Dambon et al. (2021a).
Linear Model
Let y be the response vector, let X be the covariate matrix, and let xi be the error term sampled from a zero-mean normal distribution with variance s2. Then the linear model is given by
y = Xb + xi
with coefficient vector b. The coefficients are also called fixed effects.
Spatially Varying Coefficients
We now allow the coefficients to vary from their respective mean. Let e(s) contain the location-dependent differences. In a first step, with some slight abuse of notation, the linear model from above is extended by:
y = X(b + e(s)) + xi
Note that not all coefficients necessarily must be varying. Therefore, we introduce a second covariate matrix W to specify which coefficients are spatially varying. In the case where all coefficients are varying, we have W = X. Again with some abuse of notation, we have the SVC model:
y = Xb + We(s) + xi
Gaussian Process-based Coefficients
We assume that the spatially varying coefficients are defined by Gaussian processes. That is, the deviations per covariate e_k(s) are defined as a zero-mean Gaussian process defined by some covariance function c(d, par) that models the spatial dependence between observations using the pairwise distances. Each coefficient is parameterized by a tuple of parameters par that consists of a range and variance. One main assumption of the model is that the individual coefficients per covariate, i.e., the individual Gaussian processes, are mutually independent and independent of the error.
Connection to Mixed Effect Models
For a finite number of observations n, the model can be expressed as a so-called mixed effect model. That is, using the covariance functions of the Gaussian processes and the distance matrix of the observations, we can express each e_k(s) as a multivariate, zero-mean normal distribution. Another common name for these effects are random effects. Together with the fixed effects from an ordinary linear model, we receive a so-called mixed effect model. The assumption of mutual independence between the Gaussian allows an easy construction of the joint covariance matrix S_y of the response y.
Examples
The R package contains a vignette, which is also linked here:
Version History-Pre GitHub Releases
| Version | Functionality | Release Date |
|----------------------|---------------------------------|-----------------|
| 0.3.5 | Bringing back to CRAN after some failed UT in ATLAS | 26th of March 2025 |
| 0.3.4 | | 17th of September 2022 |
| 0.3.3 | Removed some dependencies to RandomFields | 1st of June 2022 |
| 0.3.2 | Parscale option in SVCmlecontrol | 19th of July 2021 |
| 0.3.1 | New methods (summary output), pre JSS Submission | 12th of May 2021 |
| 0.3.0 | Joint variable selection method available on CRAN | 13th of January 2021 |
| 0.2.10 | parallelization using optimParallel, citation info, orcID | 23rd of February 2020 |
| 0.2.9 | Final CRAN version | 10th of October 2019 |
| 0.2.8 | Revisions for CRAN submission | 8th of October 2019 |
| 0.2.7 | add summary, printing, plotting functions, and other methods for SVC_mle objects | 16th of September 2019 |
| 0.2.6 | predictive variance | 5th of September 2019 |
| 0.2.5 | new handling of multiple observations | 10th of July 2019 |
| 0.2.4 | add SVCmle.control for SVCmle object, update vignette | 10th of July 2019 |
| 0.2.3 | add profile LL MLE, add functions to extract coefs and covariance parameters | 10th of July 2019 |
| 0.2.2 | BUGFIX: Mulitple Observations at locations. New residuals and fitted methods for SVCmle, SVCmle with formula call, warning on call without control | 5th of June 2019 |
| 0.2.1 | enable tapering | 23rd of April 2019 |
| 0.2.0 | Seperate fixed and random effects | 12th of April 2019 |
Owner
- Name: Jakob Dambon
- Login: jakobdambon
- Kind: user
- Location: Zurich
- Company: Swiss Re
- Twitter: jakobdambon
- Repositories: 1
- Profile: https://github.com/jakobdambon
Developer & Maintainer of R package “varycoef” / PhD Biostatistics @ UZH / Data Scientist @ Swiss Re / Lecturer @ HSLU
GitHub Events
Total
- Issues event: 2
- Watch event: 3
- Issue comment event: 2
- Push event: 5
- Pull request event: 2
- Create event: 2
Last Year
- Issues event: 2
- Watch event: 3
- Issue comment event: 2
- Push event: 5
- Pull request event: 2
- Create event: 2
Committers
Last synced: almost 3 years ago
All Time
- Total Commits: 88
- Total Committers: 7
- Avg Commits per committer: 12.571
- Development Distribution Score (DDS): 0.625
Top Committers
| Name | Commits | |
|---|---|---|
| jakobdambon | j****n@g****m | 33 |
| Jakob Dambon | 3****n@u****m | 31 |
| Jakob Dambon | j****n@m****h | 14 |
| KTI Projekt | k****t@f****h | 7 |
| Jakob Dambon | j****b@F****l | 1 |
| Jakob Dambon | J****n@s****m | 1 |
| Jakob Dambon | j****b@F****x | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 9
- Total pull requests: 6
- Average time to close issues: about 1 month
- Average time to close pull requests: 25 days
- Total issue authors: 2
- Total pull request authors: 2
- Average comments per issue: 1.56
- Average comments per pull request: 0.83
- Merged pull requests: 5
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 1
- Pull requests: 1
- Average time to close issues: 1 day
- Average time to close pull requests: 2 minutes
- Issue authors: 1
- Pull request authors: 1
- Average comments per issue: 2.0
- Average comments per pull request: 0.0
- Merged pull requests: 1
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- jakobdambon (8)
- JsLth (1)
Pull Request Authors
- jakobdambon (6)
- lorenzwalthert (1)
- JsLth (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- cran 676 last-month
- Total docker downloads: 21,613
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 11
- Total maintainers: 1
cran.r-project.org: varycoef
Modeling Spatially Varying Coefficients
- Homepage: https://github.com/jakobdambon/varycoef
- Documentation: http://cran.r-project.org/web/packages/varycoef/varycoef.pdf
- License: GPL-2
-
Latest release: 0.3.6
published 10 months ago
Rankings
Maintainers (1)
Dependencies
- R >= 3.5.0 depends
- ParamHelpers * imports
- glmnet * imports
- lhs * imports
- methods * imports
- mlr * imports
- mlrMBO * imports
- optimParallel >= 0.8 imports
- pbapply * imports
- smoof * imports
- spam * imports
- DiceKriging * suggests
- gstat * suggests
- parallel * suggests
- sp * suggests
- spData * suggests
- testthat >= 3.0.0 suggests