MyNixOS website logo
Description

Geo-Statistical Modeling of Spatially Referenced Data.

Provides functions for geo-statistical analysis of both continuous and count data using maximum likelihood methods. The models implemented in the package use stationary Gaussian processes with Matern correlation function to carry out spatial prediction in a geographical area of interest. The underpinning theory of the methods implemented in the package are found in Diggle and Giorgi (2019, ISBN: 978-1-138-06102-7).

RiskMap

The goal of RiskMap is to provide a set of functions for visualisation, processing and likelihood-based analysis of geostatistical data.

Installation

You can install the development version of RiskMap from GitHub with:

# install.packages("devtools")
devtools::install_github("claudiofronterre/RiskMap")

Example

This is a basic example which shows you how to solve a common problem:

library(RiskMap)
## basic example code

What is special about using README.Rmd instead of just README.md? You can include R chunks like so:

summary(cars)
#>      speed           dist       
#>  Min.   : 4.0   Min.   :  2.00  
#>  1st Qu.:12.0   1st Qu.: 26.00  
#>  Median :15.0   Median : 36.00  
#>  Mean   :15.4   Mean   : 42.98  
#>  3rd Qu.:19.0   3rd Qu.: 56.00  
#>  Max.   :25.0   Max.   :120.00

You’ll still need to render README.Rmd regularly, to keep README.md up-to-date. devtools::build_readme() is handy for this. You could also use GitHub Actions to re-render README.Rmd every time you push. An example workflow can be found here: https://github.com/r-lib/actions/tree/v1/examples.

You can also embed plots, for example:

In that case, don’t forget to commit and push the resulting figure files, so they display on GitHub and CRAN.

Estimation function design

How should the user specify the model?

# OPTION 1
y ~ rainfall + gp(x, y) + re(id_school) + re(id_region)

# Arguments for gp function
gp(long = NULL, lat = NULL, kappa = (numeric_value, default = 0.5), nugget = c(T = default, F, fixed_numeric_value), ...)

# Arguments for re function
re(numeric or categorical variable, ...) only needs an index in the dataset

glgm <- function(formula,
                 distr_offset = NULL,
                 cov_offset = NULL,
                 data,
                 family,
                 convert_to_crs = NULL,
                 scale_to_km = TRUE,
                 control_MCMC = NULL,
                 S_samples = NULL,
                 save_samples = F,
                 messages = TRUE) 

My solution to incorporate "gp" into the formula

(tf <- terms(y ~ x + x:z + gp(kappa = 0.5, nugget = TRUE)+w, specials = "gp"))
attr(tf, "specials")    # index 's' variable(s)
gp <- rownames(attr(tf, "factors"))[[attr(tf, "specials")$gp]]
gp_list <- eval(parse(text = gsub("gp","list",gp)))
gp_list
Metadata

Version

0.1.0

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows