This function allows the user to supply Bayesian estimates of \(\mu\) and \(\Sigma\) to create estimated Bayesian ellipse for niche region.
niche_ellipse(
dat_mu,
dat_sigma,
isotope_a = NULL,
isotope_b = NULL,
p_ell = NULL,
random = NULL,
set_seed = NULL,
n = NULL,
message = TRUE
)
A tibble
containing, sample_name
, sample_number
, and the
isotopes that were used in the estimation of ellipse
(i.e., and d13c
and d15n
).
a data.frame
containing \(\mu\) Bayesian estimates.
This data.frame
needs to be in long format with each \(\mu\)
estimate for each isotope stacked on top of each other. This can be produced
using extract_mu()
.
a data.frame
containing \(\Sigma\) Bayesian estimates.
This data.frame
needs be in wide format, that is \(\Sigma\) (covariance)
matrices stacked on top of each other. See example of how to convert to
wide format. This can be produced using extract_sigma()
.
character string that is the column name of the first
isotope used in dat_sigma
. Defaults to "d13c"
.
character string that is the column name of the second
isotope used in dat_sigma
. Defaults to "d15n"
.
is the confidence interval of each ellipse estimate.
Default is 0.95 (i.e., 95% confidence interval).
This value is bound by 0 and 1 and has to be a numeric
.
logical value indicating whether or not to randomly sample
posterior distributions for \(\mu\) and \(\Sigma\) to create a sub-sample
of ellipse. Default is TRUE
.
numerical value to set seed for random sampling. Default is
a random value. To consistently sample the same subsample, please supply
a numerical value (e.g., 4
). It is highly suggested to use set_seed to make
the function results when randomly sampling reproducible.
numerical value that controls the number of random samples.
Default is 10
.
control whether the time processing is displayed after the
end of the function. Default is TRUE
.
nicheROVER::niw.post()
, SIBER::siberMVN()
, extract_mu()
,
and extract_sigma()
niche_ellipse(dat_mu = mu_est_long,
dat_sigma = sigma_est_wide)
Run the code above in your browser using DataLab