Learn R Programming

SepTest (version 0.0.1)

norm3d: Trivariate normal density with independent components in space-time

Description

Evaluates a trivariate normal density on \((x,y,t)\) with independent components (diagonal covariance). The density is the product of three univariate normal densities: $$f(x,y,t) = \phi(x;\mu_x,\sigma_x)\,\phi(y;\mu_y,\sigma_y)\,\phi(t;\mu_t,\sigma_t).$$

Usage

norm3d(x, y, t, mu = c(0.3, 0.3, 0.2), sd = c(0.05, 0.05, 0.05), log = FALSE)

Value

Numeric vector of densities (or log-densities) with length determined by standard recycling rules for x, y, and t.

Arguments

x

Numeric vector of x-coordinate(s).

y

Numeric vector of y-coordinate(s).

t

Numeric vector of time coordinate(s).

mu

Numeric vector of length 3 giving c(mu_x, mu_y, mu_t).

sd

Numeric vector of length 3 giving positive standard deviations c(sd_x, sd_y, sd_t).

log

Logical; if TRUE, return the log-density.

Author

Mohammad Ghorbani mohammad.ghorbani@slu.se

References

Ghorbani, M., Vafaei, N., Dvořák, J., and Myllymäki, M. (2021). Testing the first-order separability hypothesis for spatio-temporal point patterns. Computational Statistics & Data Analysis, 161, 107245.

See Also

norm2d, get.lambda.function, estimate.st.intensity

Examples

Run this code

norm3d(0.3, 0.3, 0.2)  # peak value at the mean (with default parameters)
norm3d(c(0.2, 0.3), 0.3, 0.2)

x <- y <- seq(0, 1, length.out = 100)
z <- outer(x, y, function(x, y) norm3d(x, y, t = 0.2))
image(x, y, z, col = heat.colors(50), main = "Spatial slice of norm3d at t = 0.2")

Run the code above in your browser using DataLab