autocart {autocart} | R Documentation |
Create an autocart model
Description
Create an autocart model
Usage
autocart(response, data, locations, alpha, beta, control = NULL)
Arguments
response |
A vector of numeric response values with no NA entries. |
data |
A dataframe for the predictor variables used in the autocart tree. |
locations |
A two-column matrix with coordinates for the observations the predictor dataframe. |
alpha |
A scalar value between 0 and 1 to weight autocorrelation against reduction in variance in the tree splitting. A value of 1 indicates full weighting on measures of autocorrelation. |
beta |
A scalar value between 0 and 1 to weight the shape of the region in the splitting |
control |
An object of type "autocartControl" returned by the |
Value
An S3 object of class "autocart".
Examples
# Load some data for an autocart example
snow <- na.omit(read.csv(system.file("extdata", "ut2017_snow.csv", package = "autocart")))
y <- snow$yr50[1:40]
X <- data.frame(snow$ELEVATION, snow$MCMT, snow$PPTWT, snow$HUC)[1:40, ]
locations <- as.matrix(cbind(snow$LONGITUDE, snow$LATITUDE))[1:40, ]
# Create an autocart model with 50 trees
snow_model <- autocart(y, X, locations, 0.30, 0)
[Package autocart version 1.4.5 Index]