predict.naivedensityratio | R Documentation |
naivedensityratio
objectObtain predicted density ratio values from a naivedensityratio
object
## S3 method for class 'naivedensityratio'
predict(object, newdata = NULL, log = FALSE, tol = 1e-06, ...)
object |
A |
newdata |
Optional |
log |
A logical indicating whether to return the log of the density ratio |
tol |
Minimal density value to avoid numerical issues |
... |
Additional arguments to be passed to the function |
An array with predicted density ratio values from possibly new data, but otherwise the numerator samples.
predict
, naive
set.seed(123)
# Fit model
dr <- naive(numerator_small, denominator_small)
# Inspect model object
dr
# Obtain summary of model object
summary(dr)
# Plot model object
plot(dr)
# Plot density ratio for each variable individually
plot_univariate(dr)
# Plot density ratio for each pair of variables
plot_bivariate(dr)
# Predict density ratio and inspect first 6 predictions
head(predict(dr))
# Fit model with custom parameters
naive(numerator_small, denominator_small, m=2, kernel="epanechnikov")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.