plot_search | R Documentation |
Plots the results of a simple basis function search created by scampr::basis.search()
.
plot_search(x, ..., plot.metric = 1)
x |
a scampr model fitted via |
... |
additional plotting arguments |
plot.metric |
one or more numbers from 1 to 3 indicating the metric(s) to be plotted. 1: Fitted approximate log-likelihood. 2: Akaike's Information Criterion. 3: Bayesian Information Criterion |
# Get the flora data for one of the species
dat_po <- flora$po$sp1
dat_pa <- flora$pa
# obtain a sample of 10,000 quadrature points for the point process model
set.seed(1)
quad.pts <- flora$quad[sample(1:nrow(flora$quad), 10000, replace = F), ]
set.seed(NULL)
# Attach the quadrature points to the presence-only data
dat_po <- rbind.data.frame(dat_po, quad.pts)
# Ensure the "response" variable in each data set shares the same name
dat_po$presence <- dat_po$pres
dat_pa$presence <- dat_pa$sp1
# Fit an integrated data model without a latent effects to initialise the basis search
base.idm <- scampr(presence ~ MNT, dat_po, bias.formula = ~ D.Main,
pa.data = dat_pa, include.sre = F, model.type = "IDM", latent.po.biasing = F)
# Perform the basis search and fit the optimised model
idm <- basis.search(base.idm, return.model = TRUE)
# Plot the search results
plot_search(idm)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.