Dfunabc | R Documentation |
Distance of observed taxa versus sample distribution via ABC-rejection
Dfunabc( gradient, taxa, dist = "lnorm", pr1dist = "lnorm", par1 = 1, pr2dist = "gamma", par2 = 1, nsim = 200000, qtol = 0.005, D_min = 0, xlab = "Gradient", size = 6, print.progress = T, timing = T, penalty = F )
gradient |
A numeric vector representing the gradient along which the taxa has been observed (e.g. concentration of nutrients). |
taxa |
A character vector with the names of all taxa needs to be the same length at the gradient. |
dist |
Assumed distribution for the data generating model. This can either be a lognormal (lnrom; default) or gamma (gamma) distribution. |
pr1dist |
An argument that indicates what prior the location parameter takes "lnorm", "gamma" or "norm". for the gamma distribution this is not the scale but rate parameter, defaulting "lnorm" to scale 1. |
par1 |
An numeric argument that indicates which indicates what the scale parameter should be. |
pr2dist |
An argument that indicates what prior the scale parameter takes for "lnorm", "gamma" or "norm". for the gamma distribution this is not the scale but rate parameter, defaulting "gamma" with rate 1. |
par2 |
An numeric argument that indicates which indicates what the scale parameter should be. |
nsim |
Number of simulations used. |
qtol |
The value for the quantile tolerance. A lower value selects simulated parameters that fall closer to the observed parameters. Default is 0.01 and indicates that the closest 1 percent is accepted and the rest rejected. |
xlab |
An argument representing the name of the gradient. |
size |
Size of the points in plot "A". Default is 6 but might be to large. |
print.progress |
Prints the progress of the number of simulations completed (length of the priors). By default is TRUE |
timing |
Prints the time that was needed to complete the simulations. By default is TRUE. |
penalty |
The argument indicates whether the intervals of D and SP need to be adjusted based on the observed shift in loc linear adjustment of the distributional parameters. |
The function returns a list of 4 objects: a data frame with the Taxa with D an S, a data frame with S for all taxa, a plotted figure (ggplot2) and a data frame with the simulate, priors and distance of the accepted values of each taxa.
## Not run: library(readr) df <- read_csv(url("https://raw.githubusercontent.com/snwikaij/Data/main/Aquatic_Botany_Kaijser_et_al._2019.csv")) #Place Cl (Median) in a vector gradient = df$Mediaan #Place taxon names in a vector taxa = df$Soort #Simulate model (may take up to 5-10 min) results <- Dfunabc(df$Mediaan, df$Soort, dist = "lnorm", pr1dist = "lnorm", par1 = 0.5, nsim = 200000, qtol= 0.005, size=4) #Display the results results$Plot ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.