-
Notifications
You must be signed in to change notification settings - Fork 8
/
fields-stuff.html
170 lines (141 loc) · 5.17 KB
/
fields-stuff.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Fields supporting functions</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="R.css" />
</head><body>
<table width="100%" summary="page for fields-stuff {fields}"><tr><td>fields-stuff {fields}</td><td style="text-align: right;">R Documentation</td></tr></table>
<h2>Fields supporting functions</h2>
<h3>Description</h3>
<p>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.
</p>
<h3>Usage</h3>
<pre>
fields.diagonalize2(A,B, verbose=FALSE)
fields.diagonalize(A,B)
fields.duplicated.matrix(mat, digits = 8)
fields.mkpoly(x, m = 2)
fields.derivative.poly(x, m,dcoef)
fields.evlpoly( x, coef)
fields.evlpoly2( x, coef, ptab)
</pre>
<h3>Arguments</h3>
<table summary="R argblock">
<tr valign="top"><td><code>A</code></td>
<td>
<p>A positive definite matrix</p>
</td></tr>
<tr valign="top"><td><code>B</code></td>
<td>
<p>A positive definite matrix</p>
</td></tr>
<tr valign="top"><td><code>mat</code></td>
<td>
<p>Arbitrary matrix for examining rows</p>
</td></tr>
<tr valign="top"><td><code>digits</code></td>
<td>
<p>Number of significant digits to use for comparing
elements to determine duplciate values. </p>
</td></tr>
<tr valign="top"><td><code>x</code></td>
<td>
<p>Arbitrary matrix where rows are components of a multidimensional
vector</p>
</td></tr>
<tr valign="top"><td><code>m</code></td>
<td>
<p> The null space degree – results in a polynomial of degree
(m-1) </p>
</td></tr>
<tr valign="top"><td><code>dcoef</code></td>
<td>
<p> Coefficients of a multidimensional polynomial</p>
</td></tr>
<tr valign="top"><td><code>coef</code></td>
<td>
<p>Polynomial coefficients.</p>
</td></tr>
<tr valign="top"><td><code>ptab</code></td>
<td>
<p>Table of powers of different polnomial terms.</p>
</td></tr>
<tr valign="top"><td><code>verbose</code></td>
<td>
<p>If TRUE prints condition number of A+B</p>
</td></tr>
</table>
<h3>Details</h3>
<p>Given two matrices A (positive definite) and B (nonnegative definite)
<code>fields.diagonalize</code> and <code>fields.diagonalize2</code> finds the
matrix transformation G that will convert A to a identity matrix and B
to a diagonal matrix:
</p>
<p>G\^T A G= I G\^T B G= D.
</p>
<p><code>fields.diagonalize2</code> is not as easy to follow as <code>fields.diagonalize</code> but may be more stable
and is the version used in
the Krig engine.
</p>
<p><code>fields.duplicated</code> finds duplicate rows in a matrix. The digits
arguments is the number of digits that are considered in the
comparison.
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 <code>mat</code>.
</p>
<p><code>fields.mkpoly</code> computes the complete matrix of all monomial
terms up to degree (m-1). Each row of <code>x</code> 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:
</p>
<p>cbind( 1 , x[,1], x[,2], x[,1]**2, x[,1]*x[,2], x[,2]**2 )
</p>
<p>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
this function.
See the <code>attr</code> function for extracting an attribute from an
object.
</p>
<p><code>ptab</code> for the example above is
</p>
<pre>
[,1] [,2]
[1,] 0 0
[2,] 1 0
[3,] 0 1
[4,] 2 0
[5,] 1 1
[6,] 0 2
</pre>
<p>This information is used in finding derivatives of the polynomial.
</p>
<p><code>fields.deriviative.poly</code> finds the partial derivative matrix of
a multidimensional polynomial of degree (m-1) at different vector
values and with coefficients <code>dcoef</code>.
This function has been orgainzed to be a clean utility for the
predicting the derivative of the estimated function from Krig or
mKrig.
Within the fields context
the polynomial itself would be evaluated as
fields.mkpoly( x,m)%*%dcoef.
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
function.
</p>
<p><code>evlpoly</code> and <code>evlpoly2</code> 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.
</p>
<h3>Author(s)</h3>
<p>Doug Nychka</p>
<h3>See Also</h3>
<p>Krig, Tps, as.image, predict.Krig, predict.mKrig,
Krig.engine.default, Wendland</p>
<hr /><div style="text-align: center;">[Package <em>fields</em> version 9.9 <a href="00Index.html">Index</a>]</div>
</body></html>