MyNixOS website logo
Description

Dynamic Shrinkage Process and Change Point Detection.

Provides efficient Markov chain Monte Carlo (MCMC) algorithms for dynamic shrinkage processes, which extend global-local shrinkage priors to the time series setting by allowing shrinkage to depend on its own past. These priors yield locally adaptive estimates, useful for time series and regression functions with irregular features. The package includes full MCMC implementations for trend filtering using dynamic shrinkage on signal differences, producing locally constant or linear fits with adaptive credible bands. Also included are models with static shrinkage and normal-inverse-Gamma priors for comparison. Additional tools cover dynamic regression with time-varying coefficients and B-spline models with shrinkage on basis differences, allowing for flexible curve-fitting with unequally spaced data. Some support for heteroscedastic errors, outlier detection, and change point estimation. Methods in this package are described in Kowal et al. (2019) <doi:10.1111/rssb.12325>, Wu et al. (2024) <doi:10.1080/07350015.2024.2362269>, Schafer and Matteson (2024) <doi:10.1080/00401706.2024.2407316>, and Cho and Matteson (2024) <doi:10.48550/arXiv.2408.11315>.

dsp

Dynamic Shrinkage Processes

This package provides a full, efficient MCMC sampling algorithm for dynamic shrinkage processes (DSPs). DSPs extend popular global-local shrinkage priors, such as the horseshoe prior for sparse signals, to the time series setting by allowing the shrinkage behavior to depend on the history of the shrinkage process. The resulting processes are locally adaptive, which is important for time series data and regression functions with irregular features.


The package provides the component samplers for the Gibbs sampler for DSPs, as well as a full MCMC implementation for Bayesian trend filtering (BTF) with dynamic horseshoe processes as the prior (penalty). BTF estimates are used for curve-fitting of univariate data, typically with irregular features. The BTF model is implemented using a dynamic linear model (DLM) framework, which provides efficient computations and a platform for useful extensions. BTF penalizes differences (first or second, in this case) of the conditional expectation (i.e., the signal) to produce approximately locally constant or locally linear estimates. We use DSPs as the prior on the 1st/2nd differences, which produces curve estimates and credible bands that are highly adaptive to both rapidly- and slowly-changing features. We also provide BTF model implementations for the (static) horseshoe (HS) prior and a normal- inverse-Gamma (NIG) prior. In all cases, computations are linear in the number of time points, so the MCMC samplers are highly efficient.


Besides curve-fitting via BTF, we include full, efficient MCMC sampling algorithms for dynamic shrinkage processes applied to (1) dynamic regression with time-varying coefficients and (2) B-spline models for curve-fitting. In the dynamic regression model, we regress a dynamic (scalar) response on a vector of dynamic predictors for which the corresponding regression coefficients are time-varying. The 1st/2nd differences of the regression coefficients are penalized using DSPs (with options for HS and NIG priors), allowing for highly adaptive regression functions. In the B-spline setting, we penalize 1st/2nd differences of the B-spline basis coefficients, similar to P-splines, using DSPs (with options for HS and NIG priors). The resulting curve-fitting model is highly adaptive, like the BTF model above, but easily incorporates unequally-spaced observation points.

Installation

install.packages("dsp")

Alternatively, install the development version

install.packages("devtools")
devtools::install_github("schafert/dsp")
library("dsp")
Metadata

Version

1.2.0

License

Unknown

Platforms (76)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • 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
  • 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