conditional() for splm() and spglm() model objects, which draws simulated values from the distribution of newdata conditional on observed data.ranger, randomForest, or xgboost) account for spatial covariance. decorrelate() estimates decorrelation parameters via a grid search evaluated on training/test splits or cross-validation and fits a machine learning model to the decorrelated data; decorrelate_data(), decorrelate_grid(), decorrelate_newdata(), and recorrelate_newdata() support the underlying transformation and grid search steps; and predict(), print(), and tidy() methods are provided for decorrelate() model objects.splm()/spautor() model objects, for t-based (rather than asymptotic z-based) inference in small samples.
satterthwaite(), which computes Satterthwaite ddfs for the fixed effect coefficients of an splm() or
spautor() model object.ddf argument to splm(), spautor(), and anova() that controls whether Satterthwaite or asymptotic degrees of freedom are used for hypothesis tests. In splm() and spautor(), if n (the sample size) is less than or equal to 500, Satterthwaite ddf are computed and used, which implies a breaking change in summary() and tidy() output.confint() for confidence intervals.emmeans::joint_tests() with Satterthwaite ddf."cov", "spcov", and "randcov" values to the type argument in vcov() for splm()/spautor() model objects when using Satterthwaite ddf."weight" value to the type argument in predict(), which returns the prediction (i.e., Kriging) weights.kcv() for splm(), spautor(), spglm(), and spgautor() model objects. kcv() generalizes loocv() (leave-one-out cross validation) by holding out k (approximately equally-sized) folds instead of single observations.lake, moss, seal, and texas.delta argument to predict() and loocv() that optionally returns delta method standard errors when type = "response" and object is an spglm() or spgautor() model object.byrow_threshold argument to the local argument to predict() for splm() and spglm() model objects. When the number of observed data rows times the number of prediction data rows is smaller than byrow_threshold and there is at least one random effect or a partition factor, observed by prediction covariance matrices are computed all at once rather than row-by-row, which improves computational efficiency.predict(..., block = TRUE) for splm() model objects with big data prediction grids (newdata). The new method_new, size_new, and ordering elements supplied to the local argument control the big data prediction grid: method_new = "basis" uses an approximation based on a basis of nodes, and method_new = "subset" subsets newdata prior to block prediction.spglm() and spgautor() model objects fit using estmethod = "ml" when de and ie are at or near a numerical boundary (e.g., for spcov_type = "none"), as likelihood-based comparisons (e.g., AIC(), AICc(), BIC()) may be unreliable in this context.splm(), spautor(), spglm(), and spgautor() model objects when the covariance-parameter optimizer (optim()) does not converge.spglm() and spgautor() model objects fit using family = "binomial" when nearly all fitted probabilities are arbitrarily close to 0 or 1, indicating evidence of perfect separation.interval and level arguments to loocv() to evaluate prediciton interval coverage.. in formula, which represents the variables in data except the response and coordinate/geometry columns (xcoord, ycoord, geometry).predict() for large data now and method = "covariance" now ranks potential neighbors by the absolute value of the covariance rather than the raw value. This only affects spatial covariance types that are not monotone decreasing with distance (e.g., cosine, wave).nobs() support for splm(), spautor(), spglm(), and spgautor() model objects, which returns the observed data sample size from the model.interval = "confidence" in augment() when newdata is omitted.spglm() and spgautor() model objects for Gamma and inverse Gaussian families now scale by (the square root of) the dispersion parameter.spglm() and spgautor().offset if supplied to a modeling (e.g., splm()), diagnostic (e.g., residuals()), or prediction function (e.g., predict()).covmatrix(object, newdata, cov_type = "pred.pred", ...) when newdata was an sf object.spautor() or spgautor().predict() and loocv().spautor() and spgautor() fitted model objects.spgautor() model objects.ie value reported by splm(), spautor(), spglm() and spgautor() model objects could be smaller than the numerical floor used to build the fitted covariance matrix.spglm() when there was anisotropy and every spatial covariance and dispersion parameter was assumed known.predict() when newdata was missing expected coordinates.predict() when newdata had NA values for random effect variables.plot() on an esv() or eacf() object could fail when there were distance bins without any pairs.splm(), spautor(), spglm(), and spgautor() when a variable used in formula, random, or partition_factor was not a column of data.predict() for spautor() andspgautor() model objects ignored a user-supplied newdata argument, instead predicting for object$newdata. An informative error message is now returned.splm() and spglm() did not properly subset local$index when there were NA values in the response.precip variable in lake and lake_preds was too small by an order of 10. That is, the new values of precip are 10 times the old values (in both lake and lake_preds).reltol) passed to stats::optim(method = "Nelder-Mead", ...) from 1e-4 to 1e-6, affecting splm(), spglm(), spautor(), spgautor(), and splmRF() model objects. The intent of this change is to help prevent convergence to a local maximum that is not a global maximum. This change may affect default backwards compatibility of fitted models, depending on the shape of their objective function. If the fitted model has changed due to the change in reltol, adding control = list(reltol = 1e-4) as an argument to splm(), spglm(), spautor(), spgautor(), or splmRF() will reproduce the original fitted model.splm(..., data) and spglm(..., data) model objects having many random effect or partition factor levels in newdata that are not present in data .predict(object, newdata = newdata, block = TRUE, ...) if at least one level of a random effect or partition factor from data (used to fit object) was not present in newdata.loocv(object, local = TRUE, ...) if at least one level of a random effect or partition factor from data (used to fit object) was represented by only one observation in data.offset in data for prediction using spglm(..., data) and spgautor(..., data) model objects.offset to splm() model object fitted values when spcov_type = "none" or class(spcov_initial) = "none".tidy(..., conf.int = TRUE).eacf() to compute the empirical autocovariance function.size argument to the local argument in predict(..., block = TRUE) and augment(..., block = TRUE) from 1000 to 4000. This enhances the block prediction (i.e., Kriging) approximation's accuracy but can slightly increase computational complexity.newdata objects.xcoord and ycoord are ignored when data is an sf object.predict(object, newdata) and augment(object, newdata) that could cause NA values when the spatial covariance was "matern" and a location in newdata was the exact same as a location in data (the data argument used to fit object).splm() or spglm() converts a non-POINT geometry to a POINT geometry using sf::st_centroid().splm() or spglm() compute distances using a geographic coordinate system (and not a projected coordinate system).esv(..., cloud = TRUE)) that incorrectly doubled the semivariance.\textbf, \textsf, and \textttt LaTeX rendering issues in vignettes (#36).spmodel website titled "Block Prediction (i.e., Block Kriging) in spmodel".fc_borders data set which contains borders for the Four Corners states in the United States.covmatrix(..., cov_type = "pred.pred") was called on object with a non-NULL newdata element.esv(); see the robustargument to esv() (#28)."none" and "ie" spatial covariance types (via spcov_type or spcov_initial) to spautor(), spgautor(), and spautorRF() (#27).range_constrain argument to splm() and spglm() to constrain the range parameter to enhance numerical stability. The default for range_constrain is FALSE, implying the range is not constrained.seal data with additional polygons and a factor variable, stock, with two levels (8 and 10) that indicates seal stock (i.e., seal type).spglm() and spgautor() model objects. See this link for details."ie" spatial covariance type to splm() and spglm() models. For splm() models, "ie" is an alias for "none". For spglm() models, "none" now fixes both the de and ie covariance parameters at zero, while "ie" fixes the de covariance parameter at zero but allows the ie covariance parameter to vary. Thus, "none" from spmodel $\le$ v0.8.0 matches "ie" from spmodel v0.9.0 and but is different from "none" from spmodel v0.9.0.na.action argument to predict.spmodel() functions to clarify that missing values in newdata return an error.anova(model1, model2)) when estmethod is "ml" for both models.anova(object1, object2) when the name of object1 had special characters (e.g., $).emmeans R package for estimating marginal means of splm(), spautor(), spglm(), and spgautor() models.spmodel website titled "Using emmeans to Estimate Marginal Means of spmodel Objects".spautor() and spgautor() models via the cutoff argument, required when data are an sf object with POINT geometry and W is not specified.texas data set, which contains voter turnout data from eligible voters in Texas, USA, during the 1980 Presidential election.lake and lake_preds data sets, which contain data from the United States Environmental Protection Agency's National Lakes Assessment and LakeCat.type argument in augment() for spglm() and spgautor() models to type.predict to match broom::augment.glm().augment() for spglm() and spgautor() models now returns fitted values on the link scale by default to match broom::augment.glm().type.residuals argument for spglm() and spgautor() models to match broom::augment.glm().logLik() to match lm() and glm() behavior. logLik() now returns a vector with class logLik and attributes nobs and df.AIC() and BIC() from stats and removed spmodel-specific AIC() and BIC() methods."terms" prediction for splm(), spautor(), spglm(), and spgautor() models.scale and df arguments to predict() for splm() and spautor() models.dispersion argument to predict() for spglm() and spgautor() models.spglm() or spgautor() models when family = "beta".cov_type argument to covmatrix() to return observed by observed, prediction by observed, observed by prediction, and prediction by prediction covariance matrices.warning argument to glances() that determines whether relevant warnings should be displayed or not.glances() about interpreting likelihood-based statistics (e.g., AIC, AICc, BIC) when a one model has estmethod = "ml" and another model has estmethod = "reml".glances() about interpreting likelihood-based statistics (e.g., AIC, AICc, BIC) when two models with estmethod = "reml" have distinct formula arguments.glances() about interpreting likelihood-based statistics (e.g., AIC, AICc, BIC) when two models have different sample sizes.glances() about interpreting likelihood-based statistics (e.g., AIC, AICc, BIC) when two models have different family supports (which can happen with spglm() and spgautor() models).tbl_df and tbl classes (i.e., are tibbles).cloud argument to esv() to return a cloud semivariogram.esv() output now has tbl_df and tbl classes (i.e., are tibbles) and an esv class.plot() method for esv objects.AUROC() functions to compute the area under the receiver operating characteristic (AUROC) curve for spglm() and spgautor() models when family is "binomial" and the response is binary (i.e., represents a single success or failure).BIC() function to compute the Bayesian Information Criterion (BIC) for splm(), spautor(), spglm(), and spgautor() models when estmethod is "reml" (restricted maximum likelihood; the default) or "ml" (maximum likelihood).type argument to loocv() when cv_predict = TRUE and using spglm() or spgautor() models so that predictions may be obtained on the link or response scale.data is an sf object and a geographic (i.e., degrees) coordinate system is used instead of a projected coordinate system.local in predict.spmodel so that it depends only on the observed data sample size. Now, when the observed data sample size exceeds 10,000 local is set to TRUE by default. This change was made because prediction for big data depends almost exclusively on the observed data sample size, not the number of predictions desired.predict() with the local method "distance" on a model object fit with a random effect or partition factor.splm(..., local) and spglm(..., local).Matrix::rankMatrix(X, method = "tolNorm2") to Matrix::rankMatrix(X, method = "qr") when determining linear independence in X, the design matrix of explanatory variables.X has perfect collinearities (i.e., is not full rank). If this warning message occurs, it is possible that a subsequent error occurs while model fitting resulting from a covariance matrix that is not positive definite (i.e., a covariance matrix that is singular or computationally singular).splm() when spcov_type is "none" and there are no random effects (#15).range_positive argument to spautor() and spgautor() that when TRUE (the new default), restricts the range parameter to be positive. When FALSE (the prior default), the range parameter may be negative or positive.spautor() and spgautor() to include range parameter values near the lower and upper boundaries.local in a call to predict(object, newdata, ...)) when the model object (object) was fit using splm(formula, ...) or spglm(formula, ...) and formula contained at least one call to poly(..., raw = FALSE).splm(..., local) and spglm(..., local) to fail when a user-specified local index was passed to local that was a factor variable and at least one factor level not was observed in the local index.splm(..., partition_factor) and spglm(..., partition_factor) to fail when the partition factor variable was a factor variable and at least one factor level was not observed in the data.spgautor() that inflated the covariance matrix of the fixed effects (accessible via vcov()).sp*(spcov_params, ...) simulation functions that caused an error when spcov_params had class "car" or "sar" and W was provided by the user.newdata_size = 1 when newdata_size was omitted while predicting type = "response" for binomial families.loocv(object) when object was created using splm() or spglm(), spcov_type was "none", and there were no random effects specified via random.local argument to splm() or spglm()).loocv(object). When object was created using splm() or spautor(), loocv(object) added the squared correlation between the observed data and leave-one-out predictions, regarded as a prediction r-squared.predict() or augment()) for splm() objects when spcov_type was "none" and there were no random effects.loocv(object, local, ...) if object was created using splm(..., random) or spglm(..., random) (i.e., when random effects were specified via the random argument to splm() or spglm()).loocv(object, local, ...) if object was created using splm(..., partition_factor) or spglm(..., partition_factor) (i.e., when a partition factor was specified via the partition_factor argument to splm() or spglm()).local = TRUE in splm() and spglm() now uses the kmeans assignment method with group sizes approximately equal to 100.
random assignment method was used with group sizes approximately equal to 50.local = TRUE in predict() and augment() now uses 100 local neighbors.
spmodel" and "Technical Details" vignettes to the package website.spmodel" vignette to the package website.spmodel" vignette to "An Introduction to spmodel" and changed output type from PDF to HTML.local in predict() was TRUE.sprbinom() when the size argument was different from 1."sv-wls" estimation method.tidy() when conf.level was less than zero or greater than one.spglm() function to fit spatial generalized linear models for point-referenced data (i.e., generalized geostatistical models).
spglm() syntax is very similar to splm() syntax.spglm() fitted model objects use the same generics as splm() fitted model objects.spgautor() function to fit spatial generalized linear models for areal data (i.e., spatial generalized autoregressive models).
spgautor() syntax is very similar to spautor() syntax.spgautor() fitted model objects use the same generics as spautor() fitted model objects.augment(), made the level and local arguments explicit (rather than being passed to predict() via ...).offset support for relevant modeling functions.spcov_params() that yielded output with improper names when a named vector was used as an argument.spautor() that did not properly coerce M if given as a matrix (instead of a vector).esv() that prevented coercion of POLYGONgeometries to POINT geometries if data was an sf object.esv() that did not remove NA values from the response.splm() and spautor() that caused an error when random effects or partition factors were ordered factors.spautor() that prevented an error from occurring when a partition factor was not categorical or not a factorcovmatrix(object, newdata) that returned a matrix with improper dimensions when spcov_type was "none".predict() that caused an error when at least one level of a fixed effect factor was not observed within a local neighborhood (when the local method was "covariance" or "distance").cooks.distance() that used the Pearson residuals instead of the standardized residuals.varcomp function to compare variance components.NA values in predictors.which argument to plot() contains 8.residuals() type raw to response to match stats::lm().splm() output to "splm" from "spmod" or "splm_list" from "spmod_list".spautor() output to "spautor" from "spmod" or "spautor_list" from "spautor_list".splmRF() output to "splmRF" from "spmodRF" or "splmRF_list" from "spmodRF_list".spautorRF() output to "spautorRF" from "spmodRF" or "spautorRF_list" from "spmodRF_list".spmodel are now all documented using
an .spmodel suffix, making it easier to find documentation of a particular
spmodel method for the generic function of interest.newdata are not also in data.spcov_initial().predict()
with interval = "confidence".spmodel v0.3.0 changed the names of spmod, spmodRF, spmod_list, and spmodRF_list objects.splm() and spautor() allow multiple models to be fit when the spcov_type argument is a vector of length greater than one or the spcov_initial argument is a list (with length greater than one) of spcov_initial objects.
spmod_list. Each element of the list holds a different model fit.glances() is used on an spmod_list object to glance at each model fit.predict() is used on an spmod_list object to predict at the locations in newdata for each model fit.splmRF() and spautorRF() functions to fit random forest spatial residual models.
spmodRF (one spatial covariance) or spmodRF_list (multiple spatial covariances)predict() to perform prediction.covmatrix() function to extract covariance matrices from an spmod object fit using splm() or spautor().spmod objects.newdata.Matrix.This is the initial release of spmodel.