The functions in the ppmlasso
package require a set of quadrature points along a rectangular grid. At times a set of quadrature points with a desired spatial resolution of \(x_\delta \times y_\delta\) will have some minor machine error in some coordinates such that the coordinates as supplied do not consistute a rectangular grid. The griddify
function corrects this error as follows:
Let \(\{x_1, x_2, \ldots, x_n\}\) and \(\{y_1, y_2, \ldots, y_n\}\) be the supplied coordinates contained in envframe
. The function first determines the spatial resolution \(x_\delta \times y_\delta\) based on the median of the differences in the unique values of \(x_i\) and \(y_i\) as well as the coordinates of a rectangular grid with this spatial resolution \(\{x^{grid}_1, x^{grid}_2, \ldots, x^{grid}_n\}\) and \(\{y^{grid}_1, y^{grid}_2, \ldots, y^{grid}_n\}\). Given the tolerance \(\epsilon\) supplied to tol
, any coordinate \(x_i\) for which \(0 < \left|x_i - x^{grid}_i\right| \leq \epsilon \times x_\delta\) will be adjusted to \(x^{grid}_i\). Likewise, any coordinate \(y_i\) for which \(0 < \left|y_i - y^{grid}_i\right| \leq \epsilon \times y_\delta\) will be adjusted to \(y^{grid}_i\).
Any environmental variables contained in envframe
are left unchanged.