Synthesis with random forest
syn.rf.Rd
Generates univariate synthetic data using Breiman's random forest algorithm
classification and regression. It uses randomForest
function
from the randomForest package.
Arguments
- y
an original data vector of length
n
.- x
a matrix (
n
xp
) of original covariates.- xp
a matrix (
k
xp
) of synthesised covariates.- smoothing
smoothing method for numeric variable. See
syn.smooth
.- proper
for proper synthesis (
proper = TRUE
) a model is fitted to a bootstrapped sample of the original data.- ntree
number of trees to grow.
- ...
additional parameters passed to
randomForest
.
Value
A list with two components:
- res
a vector of length
k
with synthetic values ofy
.- fit
the fitted model which is an object of class
randomForest.
See also
syn
, syn.rf
,
syn.bag
, syn.cart
,
randomForest
,
syn.smooth