Evaluate a two-dimensional Gaussian density on a regular grid defined by lower and upper bounds in each dimension.
Arguments
- par
A list containing at least
meanandsigma, wheremeanis a numeric vector of length two andsigmais a2 x 2covariance matrix.- lower
Numeric vector of length two giving the lower bounds of the grid.
- upper
Numeric vector of length two giving the upper bounds of the grid.
- n
Number of grid cells per dimension. This can be a scalar or a length-two numeric vector.
- checkSymmetry
Logical. Passed to
mvtnorm::dmvnorm()when checking the covariance matrix.- ...
Further arguments reserved for future extensions.
Value
A list with components x, y, and z, suitable for contour or image
plotting. x and y contain the grid coordinates, and z contains the
corresponding matrix of Gaussian density values.
Details
This helper is convenient when a smooth bivariate dispersal or movement
kernel needs to be represented on a finite grid. The function uses
mvtnorm::dmvnorm() internally and returns the density values without
normalising them to sum to one over the discretised domain.
