Skip to content

katzfuss-group/BaTraMaSpa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Scalable Bayesian transport maps for non-Gaussian spatial fields

To reproduce the figures and results in Katzfuss & Schäfer (2021), please follow the file main.R. Code for Figure 3 (written in Julia) can be found in the folder figure3_julia. For a Python implementation using stochastic gradient descent of some of the methods, please see https://github.com/katzfuss-group/BaTraMaSpa_py.

To get started using the method on your own data, the following toy example may be helpful.

## load the "package"
source('https://raw.githubusercontent.com/katzfuss-group/BaTraMaSpa/main/code/nonlinearSpatial_functions.R')

## simulate some toy data
N=20^2; n=50
grid=seq(0,1,length.out=sqrt(N))
locs=as.matrix(expand.grid(grid,grid))
cov.chol=t(chol(exp(-rdist(locs)/.3)))
Y=cov.chol%*%matrix(rnorm(N*n),nrow=N)

## fit posterior transport map
fit=optimFitMapAuto(Y,locs)

## draw new sample from posterior predictive distr
newsamp=condSampAuto(fit)

## plot new sample produced via transport map
quilt.plot(locs[,1],locs[,2],newsamp,nx=sqrt(N),ny=sqrt(N))

Reference

Katzfuss, M. & Schäfer, F. (2021). Scalable Bayesian transport maps for high-dimensional non-Gaussian spatial fields. arXiv:2108.04211.

About

Scalable Bayesian transport maps for high-dimensional non-Gaussian spatial fields

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published