getrhomatrix | R Documentation |
Fits a GP model to each pair of populations and constructs a matrix of pairwise
dynamic correlation (rho
) values. The matrix can be passed to fitGP
under argument rhomatrix
.
getrhomatrix(
data = NULL,
y,
x = NULL,
pop,
time = NULL,
E = NULL,
tau = NULL,
scaling = c("global", "local", "none"),
initpars = NULL,
modeprior = 1,
fixedpars = NULL,
augdata = NULL
)
data |
A data frame, or matrix with named columns. |
y |
The response variable (required). If |
x |
Predictor variables. If |
pop |
Identifies separate populations (optional, if not supplied, defaults to 1
population). Population values can be either numeric, character, or factor.
If |
time |
A time index (optional, if not supplied, defaults to a numeric index).
Important: The time index is not used for model fitting (timesteps are
assumed to be evenly spaced) but supplying |
E |
Embedding dimension. If supplied, will be used to constuct lags of |
tau |
Time delay. If supplied, will be used to constuct lags of |
scaling |
How the variables should be scaled (see Details). Scaling can be |
initpars |
Starting values for hyperparameters (see Details) in the order
|
modeprior |
This value is used by the phi prior and sets the expected number of modes over the unit interval. Defaults to 1. |
fixedpars |
Fixes values of the hyperparameters phi, ve, and sigma2 (if desired). Should be a numeric
vector with length |
augdata |
A data frame with augmentation data (see Details). |
The pop
argument is required and there must be more than 1 population.
Function scales data prior to subsetting to each pair of populations.
A square matrix of pairwise dynamic correlations between all populations. Rows and columns are named with population names.
Rogers, T. L. and Munch, S. B. 2020. Hidden similarities in the dynamics of weakly synchronous marine metapopulation. Proceedings of the National Academy of Sciences 117(1):479-485
fitGP
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.