discriminate_nests | R Documentation |
discriminate_nests
uses CART to find sets of parameter values that
best distinguish nests from non-nests among revisited locations.
discriminate_nests(explodata, train_frac)
explodata |
|
train_frac |
Numeric. The fraction of data to use for training |
Given a dataset of revisited locations flagged as either nests or
non-nests, discriminate_nests
uses Classification and Regression Trees
(CART) to find the set (or sets) of revisitation parameters that best
distinguishes between nests and non-nests.
The function fits a CART model on the training fraction of the data, prunes the tree, and performs cross-validation using the testing fraction of the data.
The user can specify how much of the data is used for training versus testing
the algorithm. If all the data is used for training (train_frac = 1
),
cross-validation is not possible and error rates are not estimated.
The CART uses the following model formula:
nest ~ consec_days + perc_days_vis + perc_top_vis
The original tree is automatically pruned based on minimum error criterion: the tree is pruned back to the point where the cross-validated relative error (X-rel error) is at its minimum. If multiple trees compete at the minimum X-rel error, the smallest tree is picked.
A list
with the Type I and II estimated error rates
(where applicable) and a plot of the CART output.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.