x.validation {conStruct} | R Documentation |
Run a conStruct cross-validation analysis
Description
x.validation
runs a conStruct cross-validation analysis
Usage
x.validation(
train.prop = 0.9,
n.reps,
K,
freqs = NULL,
data.partitions = NULL,
geoDist,
coords,
prefix,
n.iter,
make.figs = FALSE,
save.files = FALSE,
parallel = FALSE,
n.nodes = NULL,
...
)
Arguments
train.prop |
A numeric value between 0 and 1 that gives the proportions of the data to be used in the training partition of the analysis. Default is 0.9. |
n.reps |
An |
K |
A numeric |
freqs |
A |
data.partitions |
A list with one element for each desired
cross-validation replicate. This argument can be specified
instead of the |
geoDist |
A |
coords |
A |
prefix |
A character |
n.iter |
An |
make.figs |
A |
save.files |
A |
parallel |
A |
n.nodes |
Number of nodes to run parallel analyses on. Default is
|
... |
Further options to be passed to rstan::sampling (e.g., adapt_delta). |
Details
This function initiates a cross-validation analysis that uses Monte Carlo cross-validation to determine the statistical support for models with different numbers of layers or with and without a spatial component.
Value
This function returns (and also saves as a .Robj) a list
containing the standardized results of the cross-validation analysis
across replicates. For each replicate, the function returns
a list with the following elements:
-
sp
- the mean of the standardized log likelihoods of the "testing" data partition of that replicate for the spatial model for each value of K specified inK
. -
nsp
- the mean of the standardized log likelihoods of the "testing" data partitions of that replicate for the nonspatial model for each value of K specified inK
.
In addition, this function saves two text files containing the standardized
cross-validation results for the spatial and nonspatial results
(prefix_sp_xval_results.txt and prefix_nsp_xval_results.txt, respectively).
These values are written as matrices for user convenience; each column is
a cross-validation replicate, and each row gives the result for a value of
K
.