-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathfields.html
More file actions
200 lines (177 loc) · 8.16 KB
/
Copy pathfields.html
File metadata and controls
200 lines (177 loc) · 8.16 KB
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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
<!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 - tools for spatial data</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 {fields}"><tr><td>fields {fields}</td><td style="text-align: right;">R Documentation</td></tr></table>
<h2>
fields - tools for spatial data
</h2>
<h3>Description</h3>
<p>Fields is a collection of programs for curve and function
fitting with an emphasis on spatial data and spatial statistics. The
major methods implemented include cubic and thin plate splines,
universal
Kriging and Kriging for large data sets. One main feature is any
covariance function implemented in R code can be used for spatial prediction. Another important feature is that fields will take advantage of compactly supported covariance functions in a seamless way through
the spam package. See <code>library( help=fields)</code> for a listing of all the
fields contents and I recommend the excellent fields vignette created by Ashton and Mitch:
<a href="https://github.com/NCAR/fields/blob/master/fieldsVignette.pdf">Fields Vignette</a>
</p>
<p>fields stives to have readable and tutorial code. Take a look at the
source code for <code>mKrig</code> to see how things work
"under the hood" and how a statistical, linear algebra computation is
overloaded to handle sparse matrices.
</p>
<p>To load fields with the comments retained in the source
use <code> keep.source = TRUE</code> in the <code>library</code> command.
We also keep the source on-line:
refer to the github directory
<a href="https://github.com/NCAR/Fields">https://github.com/NCAR/Fields</a> for commented source.
</p>
<p><strong>Major methods</strong>
</p>
<ul>
<li> <p><code><a href="spatialProcess.html">spatialProcess</a></code> An easy to use method that fits a spatial process model
( e.g. Kriging) but also estimates the key spatial parameters: nugget variance, sill variance and range by maximum likelihood. Default covariance model is a Matern covariance function.
</p>
</li>
<li> <p><code><a href="Tps.html">Tps</a></code> Thin Plate spline
regression including GCV and REML estimates for the smoothing parameter.
</p>
</li>
<li> <p><code><a href="Krig.html">Krig</a></code> Spatial process estimation that is the core function of fields.
</p>
<p>The Krig function allows you to supply a covariance function that is
written in native R code. See (<code><a href="exp.cov.html">stationary.cov</a></code>) that includes
several families of covariances and distance metrics including the
Matern and great circle distance.
</p>
</li>
<li> <p><code><a href="mKrig.html">mKrig</a></code> (micro Krig) are
<code><a href="Tps.html">fastTps</a></code>
fast efficient Universal Kriging and spline-like functions, that can take advantage of sparse covariance
functions and thus handle very large numbers of spatial locations.
<code><a href="QTps.html">QTps</a></code> A easy to use extension of thin plate splines for quantile and robust surface fitting.
</p>
</li>
<li> <p><code><a href="mKrigMLE.html">mKrigMLEGrid</a></code> for maximum likelihood estimates of covariance parameters. This function also
handles replicate fields assumed to be independent realizations at the same locations.
</p>
</li></ul>
<p><strong>Other noteworthy functions</strong>
</p>
<ul>
<li> <p><code><a href="vgram.html">vgram</a></code> and <code><a href="vgram.matrix.html">vgram.matrix</a></code> find variograms for spatial data (and
with temporal replications.
</p>
</li>
<li> <p><code><a href="cover.design.html">cover.design</a></code> Generates space-filling designs where the distance
function is expresed in R code.
</p>
</li>
<li> <p><code>as.image</code>, <code>image.plot</code>, <code>drape.plot</code>, <code>quilt.plot</code>
<code>add.image</code>, <code>crop.image</code>, <code>half.image</code>, <code>average.image</code>,
<code><a href="tim.colors.html">designer.colors</a></code>, <code><a href="tim.colors.html">color.scale</a></code>, <code><a href="image2lz.html">in.poly</a></code> Many
convenient functions for working with image data and rationally (well,
maybe reasonably) creating and placing a color scale on an image plot.
See also <code><a href="grid.list.html">grid.list</a></code> for how fields works with grids and <code><a href="US.html">US</a></code>
and <code><a href="world.html">world</a></code> for adding a map quickly.
</p>
</li>
<li> <p><code><a href="sreg.html">sreg</a></code> <code><a href="splint.html">splint</a></code> Fast 1-D smoothing
splines and interpolating cubic splines.
</p>
</li></ul>
<p><strong> Generic functions that support the methods</strong>
</p>
<p><code>plot</code> - diagnostic plots of fit <br />
<code>summary</code>- statistical summary of fit <br />
<code>print</code>- shorter version of summary <br />
<code><a href="fields-internal.html">surface</a></code>- graphical display of fitted surface <br />
<code>predict</code>- evaluation fit at arbitrary points <br />
<code><a href="predictSE.Krig.html">predictSE</a></code>- prediction standard errors at arbitrary points. <br />
<code><a href="sim.rf.html">sim.rf</a></code>- Simulate a random fields on a 2-d grid.
</p>
<p><strong>Getting Started</strong>
</p>
<p>Try some of the examples from help files for <code>Tps</code> or
<code>spatialProcess</code>.
</p>
<p><strong>Graphics tips</strong>
</p>
<p><code>help( fields.hints)</code>
gives some R code tricks for setting up common legends and axes.
And has little to do with this package!
</p>
<p><strong>Testing</strong>
See <code>help(fields.tests)</code> for testing fields.
</p>
<p><strong>Some fields datasets</strong>
</p>
<ul>
<li> <p><code><a href="CO2.html">CO2</a></code> Global satelite CO2 concentrations (simulated field)
</p>
</li>
<li> <p><code><a href="RCMexample.html">RCMexample</a></code> Regional climate model output
</p>
</li>
<li> <p><code><a href="lennon.html">lennon</a></code> Image of John Lennon
</p>
</li>
<li> <p><code><a href="CO.html">COmonthlyMet</a></code> Monthly mean temperatures and precip for Colorado
</p>
</li>
<li> <p><code><a href="RMprecip.html">RMelevation</a></code> Digital elevations for the Rocky Mountain Empire
</p>
</li>
<li> <p><code><a href="ozone2.html">ozone2</a></code> Daily max 8 hour ozone concentrations for the US midwest
for summer 1987.
</p>
</li>
<li> <p><code><a href="RMprecip.html">PRISMelevation</a></code> Digital elevations for the
continental US at approximately 4km resolution
</p>
</li>
<li> <p><code><a href="NorthAmericanRainfall.html">NorthAmericanRainfall</a></code> 50+ year average and trend for summer rainfall at
1700+ stations.
</p>
</li>
<li> <p><code><a href="rat.diet.html">rat.diet</a></code> Small paired study on rat food intake over time.
</p>
</li>
<li> <p><code><a href="WorldBank.html">WorldBankCO2</a></code> Demographic and carbon emission data
for 75 countries and for 1999.
</p>
</li></ul>
<p><strong>DISCLAIMER:</strong>
The
authors can not guarantee the correctness of any function or program in
this package.
</p>
<h3>Examples</h3>
<pre>
# some air quality data, daily surface ozone measurements for the Midwest:
data(ozone2)
x<-ozone2$lon.lat
y<- ozone2$y[16,] # June 18, 1987
# pixel plot of spatial data
quilt.plot( x,y)
US( add=TRUE) # add US map
fit<- Tps(x,y)
# fits a GCV thin plate smoothing spline surface to ozone measurements.
# Hey, it does not get any easier than this!
summary(fit) #diagnostic summary of the fit
set.panel(2,2)
plot(fit) # four diagnostic plots of fit and residuals.
# quick plot of predicted surface
set.panel()
surface(fit) # contour/image plot of the fitted surface
US( add=TRUE, col="magenta", lwd=2) # US map overlaid
title("Daily max 8 hour ozone in PPB, June 18th, 1987")
fit2<- spatialProcess( x,y)
# a "Kriging" model. The covariance defaults to a Matern with smoothness 1.0.
# the nugget, sill and range parameters are found by maximum likelihood
# summary, plot, and surface also work for fit2 !
</pre>
<hr /><div style="text-align: center;">[Package <em>fields</em> version 9.9 <a href="00Index.html">Index</a>]</div>
</body></html>