Skip to contents

Population level analysis of metric raster data to determine optimal Latin Hypercube sample size

Usage

calculate_lhsOpt(
  mats,
  PCA = TRUE,
  quant = TRUE,
  KLdiv = TRUE,
  minSamp = 10,
  maxSamp = 100,
  step = 10,
  rep = 10,
  iter = 10000
)

Arguments

mats

List. Output from calculate_pop function.

PCA

Logical. Calculates principal component loadings of the population for PCA similarity factor testing. default = FALSE.

quant

Logical. Perform quantile comparison testing.

KLdiv

Logical. Perform Kullback–Leibler divergence testing.

minSamp

Numeric. Minimum sample size to test. default = 10.

maxSamp

Numeric. Maximum sample size to test. default = 100.

step

Numeric. Sample step size for each iteration. default = 10.

rep

Numeric. Internal repetitions for each sample size. default = 10.

iter

Positive Numeric. The number of iterations for the Metropolis-Hastings annealing process. Defaults to 10000. Internal to clhs.

Value

data.frame with summary statistics.

Note

Special thanks to Dr. Brendan Malone for the original implementation of this algorithm.

References

Malone BP, Minasny B, Brungard C. 2019. Some methods to improve the utility of conditioned Latin hypercube sampling. PeerJ 7:e6451 DOI 10.7717/peerj.6451

Author

Tristan R.H. Goodbody

Examples

if (FALSE) {
#--- Load raster and access files ---#
r <- system.file("extdata", "mraster.tif", package = "sgsR")
mr <- terra::rast(r)

#--- calculate lhsPop details ---#
mats <- calculate_pop(mraster = mr)

calculate_lhsOpt(mats = mats)

calculate_lhsOpt(
  mats = mats,
  PCA = FALSE,
  iter = 200
)
}