- formula
formula; Formula for specifying target variable and covariates (without nearest observations and distances to them). If z~1
, an RFSI model using only nearest obsevrations and distances to them as covariates will be tuned.
- data
sf-class, sftime-class, SpatVector-class or data.frame; Contains target variable (observations) and covariates used for making an RFSI model. If data.frame object, it should have next columns: station ID (staid), longitude (x), latitude (y), 3rd component - time, depth, ... (z) of the observation, observation value (obs) and covariates (cov1, cov2, ...). If covariates are missing, the RFSI model using only nearest obsevrations and distances to them as covariates (formula=z~1
) will be tuned.
- data.staid.x.y.z
numeric or character vector; Positions or names of the station ID (staid), longitude (x), latitude (y) and 3rd component (z) columns in data.frame object (e.g. c(1,2,3,4)). If data
is sf-class, sftime-class, or SpatVector-class object, data.staid.x.y.z
is used to point staid and z position. Set z position to NA (e.g. c(1,2,3,NA)) or ommit it (e.g. c(1,2,3)) for spatial interpolation. Default is NULL.
- use.idw
boolean; IDW prediction as covariate - will IDW predictions from n.obs
nearest observations be calculated and tuned (see function near.obs). Default is FALSE.
- s.crs
st_crs or crs; Source CRS of data
. If data
contains crs, s.crs
will be overwritten. Default is NA.
- p.crs
st_crs or crs; Projection CRS for data
reprojection. If NA, s.crs
will be used for distance calculation. Note that observations should be in projection for finding nearest observations based on Eucleadean distances (see function near.obs). Default is NA.
- tgrid
data.frame; Possible tuning parameters. The column names are same as the tuning parameters. Possible tuning parameters are: n.obs
, num.trees
, mtry
, min.node.size
, sample.fraction
, splirule
, idw.p
, and depth.range
.
- tgrid.n
numeric; Number of randomly chosen tgrid
combinations for tuning of RFSI. If larger than tgrid
, will be set to length(tgrid)
- tune.type
character; Type of cross-validation: leave-location-out ("LLO"), leave-time-out ("LTO") - TO DO, and leave-location-time-out ("LLTO") - TO DO. Default is "LLO".
- k
numeric; Number of random folds that will be created with CreateSpacetimeFolds function if folds
is column. Default is 5.
- seed
numeric; Random seed that will be used to generate folds with CreateSpacetimeFolds function.
- folds
numeric or character vector or value; Showing folds column (if value) or rows (vector) of data
observations used for cross-validation. If missing, will be created with CreateSpacetimeFolds function.
- acc.metric
character; Accuracy metric that will be used as a criteria for choosing an optimal RFSI model. Possible values for regression: "ME", "MAE", "NMAE", "RMSE" (default), "NRMSE", "R2", "CCC". Possible values for classification: "Accuracy","Kappa" (default), "AccuracyLower", "AccuracyUpper", "AccuracyNull", "AccuracyPValue", "McnemarPValue".
- fit.final.model
boolean; Fit the final RFSI model. Defailt is TRUE.
- cpus
numeric; Number of processing units. Default is detectCores()-1.
- progress
logical; If progress bar is shown. Default is TRUE.
- soil3d
logical; If 3D soil modellig is performed and near.obs.soil function is used for finding n nearest observations and distances to them. In this case, z position of the data.staid.x.y.z
points to the depth column.
- no.obs
character; Possible values are increase
(default) and exactly
. If set to increase
, in case if there is no n.obs
observations in depth.range
for a specific location, the depth.range
is increased (multiplied by 2, 3, ...) until the number of observations are larger or equal to n.obs
. If set to exactly
, the function will raise an error when it come to the first location with no n.obs
observations in specified depth.range
(see function near.obs.soil).
- ...
Further arguments passed to ranger.