View source: R/MRFcov_spatial.R
MRFcov_spatial | R Documentation |
This function calls the MRFcov
function to fit
separate penalized regressions for each node and approximate parameters of
Markov Random Fields (MRF) graphs. Supplied GPS coordinates are used to
account for spatial autocorrelation via Gaussian Process spatial regression
splines.
MRFcov_spatial(
data,
symmetrise,
prep_covariates,
n_nodes,
n_cores,
n_covariates,
family,
coords,
prep_splines = TRUE,
bootstrap = FALSE,
progress_bar = FALSE
)
data |
A |
symmetrise |
The method to use for symmetrising corresponding parameter estimates
(which are taken from separate regressions). Options are |
prep_covariates |
Logical. If |
n_nodes |
Positive integer. The index of the last column in |
n_cores |
Positive integer. The number of cores to spread the job across using
|
n_covariates |
Positive integer. The number of covariates in |
family |
The response type. Responses can be quantitative continuous ( |
coords |
A two-column |
prep_splines |
Logical. If spatial splines are already included in |
bootstrap |
Logical. Used by |
progress_bar |
Logical. Progress bar in pbapply is used if |
A list
of all elements contained in a returned MRFcov
object, with
the inclusion of a dataframe
called mrf_data
. This contains all prepped covariates
including the added spatial regression
splines, and should be used as data
when generating predictions
via predict_MRF
or predict_MRFnetworks
Kammann, E. E. and M.P. Wand (2003) Geoadditive Models. Applied Statistics 52(1):1-18.
See smooth.construct2
and smooth.construct.gp.smooth.spec
for details of Gaussian process spatial regression splines. Worked examples to showcase
this function can be found using vignette("Bird_Parasite_CRF")
data("Bird.parasites")
Latitude <- sample(seq(120, 140, length.out = 100), nrow(Bird.parasites), TRUE)
Longitude <- sample(seq(-19, -22, length.out = 100), nrow(Bird.parasites), TRUE)
coords <- data.frame(Latitude = Latitude, Longitude = Longitude)
CRFmod_spatial <- MRFcov_spatial(data = Bird.parasites, n_nodes = 4,
family = 'binomial', coords = coords)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.