View source: R/predict_invasible.R
| predict_invasible | R Documentation |
Fits a phylogenetic generalized linear mixed model (PGLMM) from the
output of invasion_signal()
Calculates the probability of being invasive for all species,
based on the phylogeny (and optionally species traits) given to the
original prepare_invasible() function
Computes predictive performance metrics such as ROC AUC
Plots the predicted values for observed invasive species (1) vs non-invading species (0) (optional)
predict_invasible(signal, vcv_alpha = NULL, plot = FALSE, fam = "gaussian")
signal |
Output of |
vcv_alpha |
Numeric, optional: set a value of alpha for OU model which is
different to the value inherited from the |
plot |
Logical. If TRUE, returns diagnostic plot of observed vs predicted |
fam |
Character, Distribution family of the model (if other than "binomial") |
An object of class pred_output, a list containing:
Fitted PGLMM model object.
Data frame with observed and predicted values for all species.
Candidate invasives ordered by decreasing probability.
ROC object
Numeric AUC (area under the curve) value.
ggplot object (if requested; run pred_output$plot to show).
species_list <- fish_beginning_with_E
prep <- prepare_invasible(species_list,rho=1, predictors=c("Fake_continuous_trait"))
signal <- invasion_signal(prep)
pred <- predict_invasible(signal,plot=TRUE)
pred$ranked_predictions
pred$auc
pred$plot
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.