Description Usage Arguments Details Value Author(s) See Also Examples
Generates Gaussian random fields (GRFs) and related fields via transformations. The spatial covariances are modeled using Matern's model.
For examples see
http://faculty.missouri.edu/~micheasa/sppmix/sppmix_all_examples.html#rGRF
1 2 |
mu |
Mean of the stationary GRF. |
gentype |
Set to 0 for Gaussian, 1 for Chi-square. Default
is |
xlims, ylims |
Vectors defining the grid limits of the x-y locations over which to compute the covariance matrix. |
LL |
Length of the side of the square grid. |
df |
Degrees of freedom (an integer) for the
chi-square random field when |
nu, theta, sig |
Matern model
parameters. See |
pattern |
Optionally, a point pattern
as an object of type |
The code of the rGRF
function
uses a modification of the functions sim.rf
and matern.image.cov
from the
fields
package, by Douglas Nychka,
Reinhard Furrer, John Paige, and Stephan Sain.
Depending on the choice of the Matern model parameters
we might end up having trouble with the FFT giving
negative values. The code accounts for this event and
adjusts the range of values via an increasing
variable incr
. If it still takes a
long time to generate the fields try increasing the
domain of observation using wider xlims
and ylims
.
An image as an object of class im.object
,
containing the realization of the field over the grid. If
argument pattern
was supplied, the return
value is now a list contaning the realization of the field as
an image, augmented by the marked point pattern
with locations in pattern
and marks the field
values over these locations. This capability is illustrated
for realizations of marked point processes
conditioning on continuous marks. See
function rMIPPP_cond_loc
for more details.
Sakis Micheas
MaternCov
,
plot_density
,
ggtitle
,
add_title
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | #Gaussian random field as an image
GRF1=rGRF()
p<-plot_density(as.data.frame(GRF1))
p_title<-expression( paste("GRF with Matern covariances, ", theta,"=1,",mu,"=0,",nu, "=.5,",
sigma,"=1"))
p+ggplot2::ggtitle(p_title)
#or simply use the add_title function
p+add_title("GRF with Matern model covariances", mu=0,theta=1,nu=.5,sigma=1)
#Chi-Square random field as an image
ChiSqRF=rGRF(gentype=1,df=10)
p<-plot_density(as.data.frame(ChiSqRF))
p+add_title(paste(chi^{2}," random fields with Matern model covariances for the GRFs"),
mu=0,theta=1,nu=.5,sigma=1,df=10)
#Log-Gaussian random field as an image
GRF2=rGRF()
LogGRF=exp(rGRF())
p<-plot_density(as.data.frame(LogGRF))
p+add_title("Log-Gaussian random field with Matern model covariances", mu=0,theta=1,
nu=.5,sigma=1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.