Some supporting functions that are internal to fields top level methods. Variants of these might be found in the R base but these have been written for cleaner code or efficiency.
1 2 3 4 5 6 7 8 9
Arbitrary matrix for examining rows
Number of significant digits to use for comparing elements to determine duplciate values.
Arbitrary matrix where rows are components of a multidimensional vector
The null space degree – results in a polynomial of degree (m-1)
Coefficients of a multidimensional polynomial
Table of powers of different polnomial terms.
fields.duplicated finds duplicate rows in a matrix. The digits
arguments is the number of digits that are considered in the
The returned value is an array of integers from 1:M where M is the
number of unique rows and duplicate rows are referenced in the same
order that they appear as the rows of
fields.mkpoly computes the complete matrix of all monomial
terms up to degree (m-1). Each row of
x is are the componets of
a vector. (The fields function mkpoly returns the number of these
terms.) In 2 dimensions with m=3 there 6 polynomial terms up to
quadratic ( 3-1 =2) order and will be returned as the matrix:
cbind( 1 , x[,1], x[,2], x[,1]**2, x[,1]*x[,2], x[,2]**2 )
This function is used for the fixed effects polynomial or spatial
drift used in spatial estimating functions Krig, Tps and mKrig.
The matrix ptab is a table of the powers in each term for each
variable and is included as an attribute to the matrix returned by
attr function for extracting an attribute from an
ptab for the example above is
1 2 3 4 5 6 7
This information is used in finding derivatives of the polynomial is also used to create column names for the terms that are of higher order than linear.
fields.deriviative.poly finds the partial derivative matrix of
a multidimensional polynomial of degree (m-1) at different vector
values and with coefficients
This function has been orgainzed to be a clean utility for the
predicting the derivative of the estimated function from Krig or
Within the fields context
the polynomial itself would be evaluated as
If x has d columns ( also the dimension of the polynomial) and n rows
the partial derivatives of this polynomial at the locations x can be
organized in a nXd matrix. This is the object returned by ths
evlpoly2 are FORTRAN based functions for
evaluating univariate polynomials and multivariate polynomials. The
table of powers (ptab) needed for evlpoly2 is the same format as that
returned my the fields.mkpoly function.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.