Bernstein Basis Functions

Description Usage Arguments Details Examples

Concatenate basis functions column-wise

1 2 |

`...` |
named objects of class |

`recursive` |
always |

`c()`

joins the corresponding design matrices
column-wise, ie, the two functions defined by the two bases
are added.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ```
### set-up Bernstein and log basis functions
xv <- numeric_var("x", support = c(1, pi))
bb <- Bernstein_basis(xv, order = 3, ui = "increasing")
lb <- log_basis(xv, remove_intercept = TRUE)
### join them
blb <- c(bern = bb, log = lb)
### generate data + coefficients
x <- as.data.frame(mkgrid(blb, n = 100))
cf <- c(1, 2, 2.5, 2.6, 2)
### evaluate bases
model.matrix(blb, data = x[1:10, ,drop = FALSE])
### evaluate and plot function defined by
### bases and coefficients
plot(x$x, predict(blb, newdata = x, coef = cf), type = "l")
### evaluate and plot first derivative of function
### defined by bases and coefficients
plot(x$x, predict(blb, newdata = x, coef = cf, deriv = c(x = 1)),
type = "l")
``` |

basefun documentation built on May 21, 2017, 12:45 a.m.

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs in the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.