fit_nngp: Fit the nearest-neighbor Gaussian process.

Description Usage Arguments Details Value Examples

View source: R/wrappers.R

Description

Run the MCMC to fit the nearest-neighbor Gaussian process for a collection of window sizes.

Usage

1
fit_nngp(infile, outpath, num_neighbors = 1, iters = 15000, parallel = FALSE, ncores = 10, return = FALSE)

Arguments

infile

Path to the rds file output by run_scc_scan

outpath

Path to where the output will be written. The output file should be given the .rds file extension.

num_neighbors

Integer number of nearest neighbors to use. Defaults to 1.

iters

Number of MCMC iterations to use. Defaults to 15,000

parallel

Logical. Should the MCMC fitting be parallelized?

ncores

If parallel = TRUE, number of cores to parallelize over.

return

Logical. Should the output also be returned by the function?

Details

This function fits the nearest-neighbor Gaussian process for the window sizes used in the SCC scan associated with the infile.

Value

If return = TRUE, this function outputs a list of posterior samples across the window sizes contained in the infile.

Examples

1
2
# Fit the nearest-neighbor Gaussian process model via MCMC
fit_nngp(infile = "inst/extdata/output/z.rds", outpath = "inst/extdata/output/fit.rds", num_neighbors = 1, iters = 150, parallel = FALSE)

hillarykoch/locdiffr documentation built on April 25, 2021, 6:26 p.m.