sim_cond_normal: Create a helper function to simulate from the conditional...

View source: R/sim_cond_normal.R

sim_cond_normalR Documentation

Create a helper function to simulate from the conditional normal distribution of new data given old data

Description

Create a helper function to simulate from the conditional normal distribution of new data given old data

Usage

sim_cond_normal(joint.mean, a, locs_new, locs_obs, kernel, ...)

Arguments

joint.mean

The length n mean vector of the MVN distribution. By default mu1 is the first m elements of joint.mean

a

A vector of length n-m, the values of mu2 to condition on

locs_new

A matrix containing the coordiantes of new locations

locs_obs

A matrix containing the coordinates of observed locations

kernel

A function (kernel function) that returns a matrix containing the similarity between the two arguments.

...

Hyperparameters to pass to the kernel function.

Details

This serves as a helper function for spatialGEV_predict. The notations are consistent to the notations on the MVN wikipedia page

Value

A function that takes in one argument n as the number of samples to draw from the condition normal distribution of locs_new given locs_obs: either from rmvnorm for MVN or rnorm for univariate normal. The old and new data are assumed to follow a joint multivariate normal distribution.


SpatialGEV documentation built on June 22, 2024, 9:24 a.m.