NSconvo_fit {convoSPAT} | R Documentation |
Fit the nonstationary spatial model
Description
NSconvo_fit
estimates the parameters of the nonstationary
convolution-based spatial model. Required inputs are the observed data and
locations. Optional inputs include mixture component locations (if not provided,
the number of mixture component locations are required), the fit radius,
the covariance model (exponential is the default), and whether or not the
nugget and process variance will be spatially-varying.
Usage
NSconvo_fit(
sp.SPDF = NULL,
coords = NULL,
data = NULL,
cov.model = "exponential",
mean.model = data ~ 1,
mc.locations = NULL,
N.mc = NULL,
lambda.w = NULL,
fixed.nugg2.var = NULL,
mean.model.df = NULL,
mc.kernels = NULL,
fit.radius = NULL,
ns.nugget = FALSE,
ns.variance = FALSE,
ns.mean = FALSE,
local.aniso = TRUE,
fix.tausq = FALSE,
tausq = 0,
fix.kappa = FALSE,
kappa = 0.5,
method = "reml",
print.progress = TRUE,
local.pars.LB = NULL,
local.pars.UB = NULL,
global.pars.LB = NULL,
global.pars.UB = NULL,
local.ini.pars = NULL,
global.ini.pars = NULL
)
Arguments
sp.SPDF |
A " |
coords |
An N x 2 matrix where each row has the two-dimensional coordinates of the N data locations. |
data |
A vector or matrix with N rows, containing the data values. Inputting a vector corresponds to a single replicate of data, while inputting a matrix corresponds to replicates. In the case of replicates, the model assumes the replicates are independent and identically distributed. |
cov.model |
A string specifying the model for the correlation
function; defaults to |
mean.model |
An object of class |
mc.locations |
Optional; matrix of mixture component locations. |
N.mc |
Optional; if |
lambda.w |
Scalar; tuning parameter for the weight function. Defaults to be the square of one-half of the minimum distance between mixture component locations. |
fixed.nugg2.var |
Optional; describes the variance/covariance for a fixed (second) nugget term (represents a known error term). Either a vector of length N containing a station-specific variances (implying independent error) or an NxN covariance matrix (implying dependent error). Defaults to zero. |
mean.model.df |
Optional data frame; refers to the variables used
in |
mc.kernels |
Optional specification of mixture component kernel matrices (based on expert opinion, etc.). |
fit.radius |
Scalar; specifies the fit radius or neighborhood size for the local likelihood estimation. |
ns.nugget |
Logical; indicates if the nugget variance (tausq) should
be spatially-varying ( |
ns.variance |
Logical; indicates if the process variance (sigmasq)
should be spatially-varying ( |
ns.mean |
Logical; indicates if the mean coefficeints (beta)
should be spatially-varying ( |
local.aniso |
Logical; indicates if the local covariance should be
anisotropic ( |
fix.tausq |
Logical; indicates whether the default nugget term
(tau^2) should be fixed ( |
tausq |
Scalar; fixed value for the nugget variance (when
|
fix.kappa |
Logical; indicates if the kappa parameter should be
fixed ( |
kappa |
Scalar; value of the kappa parameter. Only used if
|
method |
Indicates the estimation method, either maximum likelihood
( |
print.progress |
Logical; if |
local.pars.LB , local.pars.UB |
Optional vectors of lower and upper
bounds, respectively, used by the |
global.pars.LB , global.pars.UB |
Optional vectors of lower and upper
bounds, respectively, used by the |
local.ini.pars |
Optional vector of initial values used by the
|
global.ini.pars |
Optional vector of initial values used by the
|
Value
A "NSconvo" object, with the following components:
mc.locations |
Mixture component locations used for the simulated data. |
mc.kernels |
Mixture component kernel matrices used for the simulated data. |
MLEs.save |
Table of local maximum likelihood estimates for each mixture component location. |
kernel.ellipses |
|
data |
Observed data values. |
beta.GLS |
Generalized least squares estimates of beta,
the mean coefficients. For |
beta.cov |
Covariance matrix of the generalized least squares
estimate of beta. For |
Mean.coefs |
"Regression table" for the mean coefficient estimates,
listing the estimate, standard error, and t-value (for |
tausq.est |
Estimate of tausq (nugget variance), either scalar (when
|
sigmasq.est |
Estimate of sigmasq (process variance), either scalar
(when |
beta.est |
Estimate of beta (mean coefficients), either a vector
(when |
kappa.MLE |
Scalar maximum likelihood estimate for kappa (when applicable). |
Cov.mat |
Estimated covariance matrix ( |
Cov.mat.chol |
Cholesky of |
cov.model |
String; the correlation model used for estimation. |
ns.nugget |
Logical, indicating if the nugget variance was estimated
as spatially-varing ( |
ns.variance |
Logical, indicating if the process variance was
estimated as spatially-varying ( |
fixed.nugg2.var |
N x N matrix with the fixed variance/covariance for the second (measurement error) nugget term (defaults to zero). |
coords |
N x 2 matrix of observation locations. |
global.loglik |
Scalar value of the maximized likelihood from the global optimization (if available). |
Xmat |
Design matrix, obtained from using |
lambda.w |
Tuning parameter for the weight function. |
fix.kappa |
Logical, indicating if kappa was fixed ( |
kappa |
Scalar; fixed value of kappa. |
Examples
## Not run:
# Using white noise data
fit.model <- NSconvo_fit( coords = cbind( runif(100), runif(100)),
data = rnorm(100), fit.radius = 0.4, N.mc = 4 )
## End(Not run)