predict.lhss {densityratio} | R Documentation |
Obtain predicted density ratio values from a lhss
object
Description
Obtain predicted density ratio values from a lhss
object
Usage
## S3 method for class 'lhss'
predict(
object,
newdata = NULL,
sigma = c("sigmaopt", "all"),
lambda = c("lambdaopt", "all"),
...
)
Arguments
object |
A |
newdata |
Optional |
sigma |
A scalar with the Gaussian kernel width |
lambda |
A scalar with the regularization parameter |
... |
Additional arguments to be passed to the function |
Value
An array with predicted density ratio values from possibly new data, but otherwise the numerator samples.
See Also
Examples
set.seed(123)
# Fit model (minimal example to limit computation time)
dr <- lhss(numerator_small, denominator_small,
nsigma = 5, nlambda = 3, ncenters = 50, maxit = 100)
# 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))
[Package densityratio version 0.2.2 Index]