log_basis | R Documentation |
The logarithmic basis function
log_basis(var, ui = c("none", "increasing", "decreasing"), remove_intercept = FALSE)
var |
a |
ui |
a character describing possible constraints |
remove_intercept |
a logical indicating if the intercept term shall be removed |
log_basis
returns a function for the evaluation of
the basis functions with corresponding model.matrix
and predict
methods.
### set-up basis lb <- log_basis(numeric_var("x", support = c(0.1, pi))) ### generate data + coefficients x <- as.data.frame(mkgrid(lb, n = 100)) ### 1 + 2 * log(x) max(abs(predict(lb, newdata = x, coef = c(1, 2)) - (1 + 2 * log(x$x))))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.