View source: R/define_tolerance.R

Define tolerance values for ABC model in mcfly

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ```
define_tolerance(
comm,
phylo,
envir,
xy.coords,
occurrence,
entropy.order,
niche.breadth = 10,
m = 0.5,
n.timestep = 50,
summary.stat = "correlation",
OU.alpha = c("uniform", "half-life"),
max.sample.size.prior = 100 * parallel,
sample.size.posterior = 20 * parallel,
parallel = NULL,
scenario.ID = "doc",
output.dir.path = "einstein",
probs = c(0.8, 0.9, 0.95, 0.99)
)
``` |

`comm` |
Matrix containing occurrences or abundances of species in sites. Species in columns and sites in rows. |

`phylo` |
Newick object containing the phylogenetic relationship among species. |

`envir` |
A one column matrix containing environmental variable for each community |

`xy.coords` |
A two column matrix containing the coordinates of each community |

`occurrence` |
Logical argument (TRUE or FALSE) indicating if community matrix must be transformed to presence/absence |

`entropy.order` |
Numeric value indicating the scale of Rényi diversity, as accepted by |

`niche.breadth` |
Numeric value indicating the width of niche of species in the metacommunity, as accepted by |

`m` |
Numeric value indicating the immigration rate at each site, reported as Hubbel´s m. This is the same parameter accepted by |

`n.timestep` |
Numeric value indicating the number of timesteps used in the simulation of metacommunities,
this is the same argument used in |

`summary.stat` |
Character indicating the type of summary statistic that will be used in ABC model. Default is "correlation", that is calculated as the correlation between the diversity values calculated according to the Rényi scale defined in entropy.order argument. |

`OU.alpha` |
Character indicating the type of prior that will be used in ABC model. The options were "uniform" for a uniform sample of alpha values and "half-life" for a prior of alpha values represented as being half-life values, calculated as being log(). |

`max.sample.size.prior` |
Numeric indicating the maximum number of sampling in prior distribution. Default is 100 times the number of parallel process. |

`sample.size.posterior` |
Numeric value that defines the minimum size of the posterior distribution. Default is 240. |

`parallel` |
Numerical value indicating the numbers of cores that must be used in the parallel computation. Default is NULL, indicating that the calculations of ABC model will not be parallelized. |

`scenario.ID` |
Character indicating the name of the simulation scenario. The same as used in |

`output.dir.path` |
Character indicating the name of directory to save simulations results and metadata used in |

`probs` |
Numeric indicating the quantiles to be used in tolerance distribution values. Default is c(0.8,0.9,0.95,0.99) |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.