prob_zk: Posterior Density Estimation at a Single Location

View source: R/prob_zk.R

prob_zkR Documentation

Posterior Density Estimation at a Single Location

Description

Computes the posterior and plots probability density function (PDF) at a single unobserved spatial location using the Bayesian Maximum Entropy (BME) framework. This function integrates both hard data (precise measurements) and soft data (interval or uncertain observations), together with a specified variogram model, to numerically estimate the posterior density across a range of possible values.

Usage

prob_zk(x, data_object, model, nugget, sill, range,
               nsmax = 5, nhmax = 5, n = 50,
               zk_range = extended_range(data_object))

Arguments

x

A two-column matrix of spatial coordinates for a single estimation location.

data_object

A list containing the hard and soft data.

model

A string specifying the variogram or covariance model to use (e.g., "exp", "sph", etc.).

nugget

A non-negative numeric value for the nugget effect in the variogram model.

sill

A numeric value representing the sill (total variance) in the variogram model.

range

A positive numeric value for the range (or effective range) parameter of the variogram model.

nsmax

An integer specifying the maximum number of nearby soft data points to include for estimation (default is 5).

nhmax

An integer specifying the maximum number of nearby hard data points to include for estimation (default is 5).

n

An integer indicating the number of points at which to evaluate the posterior density over zk_range (default is 50).

zk_range

A numeric vector specifying the range over which to evaluate the unobserved value at the estimation location (zk). Although zk is unknown, it is assumed to lie within a range similar to the observed data (zh, a, and b). It is advisable to explore the posterior distribution at a few locations using prob_zk() before finalizing this range

Value

A data frame with two columns: zk_i (assumed zk values) and prob_zk_i (corresponding posterior densities).

Examples

data("utsnowload")
x <- utsnowload[1, c("latitude", "longitude")]
ch <- utsnowload[2:67, c("latitude", "longitude")]
cs <- utsnowload[68:232, c("latitude", "longitude")]
zh <- utsnowload[2:67, "hard"]
a <- utsnowload[68:232, "lower"]
b <- utsnowload[68:232, "upper"]
data_object <- bme_map(ch, cs, zh, a , b)
prob_zk(x, data_object, model = "exp",
        nugget = 0.0953, sill = 0.3639, range = 1.0787)


BMEmapping documentation built on Aug. 21, 2025, 5:55 p.m.