MyNixOS website logo
Description

Multi-Resolution Thin-Plate Splines on the Sphere.

Constructs multi-resolution thin-plate spline basis functions on the sphere for use in spatial regression and large-scale spatial prediction problems. Implements the basis system described in Huang, Huang, and Ing (2025) "Multi-Resolution Spatial Methods on the Sphere: Efficient Prediction for Global Data", Environmetrics, <doi:10.1002/env.70092>. Heavy computations are written in 'C++' via 'Rcpp' with optional 'OpenMP' parallelism.

mrtsSphere

License: GPL v2+

Multi-resolution thin-plate spline (MRTS) basis functions on the sphere for large-scale spatial regression and prediction. R implementation of the method in:

Multi-resolution approximations of Gaussian processes for large spatial datasets on the sphere.Environmetrics, 2025. DOI: 10.1002/env.70092

The basis is constructed from the eigen-decomposition of a centered spherical kernel and is evaluated on the prediction grid via a parallel C++ routine (Rcpp + optional OpenMP).

Installation

# install.packages("remotes")
remotes::install_github("STLABTW/multi-resolution-sphere")

The package compiles C++ code on installation; you need a working toolchain (Xcode CLT on macOS, Rtools on Windows, r-base-dev on Linux). OpenMP is optional — without it the package still works, single-threaded.

Quick start

library(mrtsSphere)

# Build a 20 x 10 grid of (lat, lon) locations on the sphere.
n_lon  <- 20
n_lat  <- 10
lon_seq <- seq(-180, 176, length.out = n_lon)
lat_seq <- seq( -90,  87, length.out = n_lat)
grid <- as.matrix(expand.grid(lat = lat_seq, lon = lon_seq))

# Pick 100 knots at random.
set.seed(1)
knots <- grid[sample(nrow(grid), 100), ]

# 10 multi-resolution basis functions evaluated on the full grid.
res <- mrts_sphere(knots, k = 10, X = grid)
dim(res$mrts)   # 200 x 10

A longer worked example that simulates a spherical Gaussian random field with fields and recovers it through the basis ships with the package at:

system.file("articles", "mrtsSphere.Rmd", package = "mrtsSphere")

(Render with rmarkdown::render() if you have pandoc installed.)

Reproducing the paper

The original analysis scripts from the paper are bundled under inst/paper/. After installing the package:

file.path(system.file("paper", package = "mrtsSphere"), "fullmodel-max.R")

The SST input dataset (data_sst_max_20240419.csv) is tracked via Git LFS in this repository.

Citation

citation("mrtsSphere")

License

GPL (>= 2). See LICENSE for details.

Metadata

Version

0.1.2

License

Unknown

Platforms (80)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    uefi
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-uefi
  • aarch64-windows
  • aarch64_be-none
  • arc-linux
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • 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-linux
  • 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
  • sh4-linux
  • 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-uefi
  • x86_64-windows