strnorm: Simulate a Spatio-Temporal Random Variable

Description Usage Arguments Value

View source: R/strnorm.R

Description

Simulate a Spatio-Temporal Random Variable

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
strnorm(object, mu, size, condition = 1e-04, error, ...)

## S3 method for class 'matrix'
strnorm(object, mu, size, condition = 1e-04, error, ...)

## Default S3 method:
strnorm(
  object,
  mu,
  size,
  condition = 1e-04,
  error,
  xcoord,
  ycoord = NULL,
  tcoord,
  data,
  s_cor,
  t_cor,
  chol = FALSE,
  h_options = NULL,
  ...
)

Arguments

object

An covariance matrix or a "covparam" object.

mu

A mean vector with length equal to the number of rows in data or a scalar.

size

The number of independent simulations

condition

A small number added to the diagonals of matrices before inverting them to prevent ill-conditioning (defaults to 1e-4).

error

The random error type

normal

All random effects are Gaussian and mutually independent.

component_squared

Gaussian, mutually independent random effects are simulated, squared, and rescaled to match the sample variance on the Gaussian scale.

sum_squared

Gaussian, mutually independent random effects are simulated, summed, squared, and rescaled to match the sample variance on the Gaussian scale.

...

Additional arguments.

xcoord

A character vector specifying the column name of the x-coordinate variable in data.

ycoord

A character vector specifying the column name of the y-coordinate variable in data.

tcoord

A character vector specifying the column name of the t-coordinate (time) variable in data.

data

A data object containing all necessary variables.

s_cor

The spatial correlation

exponential

The exponential correlation (the default).

spherical

The spherical correlation.

gaussian

The Gaussian correlation.

t_cor

The temporal correlation

exponential

The exponential correlation (the default).

spherical

The spherical correlation.

gaussian

The Gaussian correlation.

tent

The tent (linear with sill) correlation.

chol

Should the Cholesky decomposition be used? If FALSE, efficient inversion algorithms are implemented. Defaults to FALSE.

h_options

A list containing options to compute distances if response, xcoord, ycoord, and tcoord are provided. Named arguments are

h_t_distmetric

The temporal distance matrix (defaults to "euclidean").

h_s_distmetric

The spatial distance matrix (defaults to "euclidean").

Value

A vector of random variables (if size = 1) or a matrix of random variables (if size > 1) whose columns indicate seprate simulations. The row order corresponds to the rows of the covariance matrix (if object is a matrix) or the rows of data (if object is a covparam object.


michaeldumelle/DumelleEtAl2021STLMM documentation built on Dec. 21, 2021, 5:56 p.m.