intercept_basis: Intercept-Only Basis Function

Description Usage Arguments Details Examples

View source: R/intercept.R

Description

A simple intercept as basis function

Usage

1
intercept_basis(ui = c("none", "increasing", "decreasing"), negative = FALSE)

Arguments

ui

a character describing possible constraints

negative

a logical indicating negative basis functions

Details

intercept_basis returns a function for the evaluation of the basis functions with corresponding model.matrix and predict methods.

Examples

1
2
3
4
5
6
7
8
  ### set-up basis
  ib <- intercept_basis()

  ### generate data + coefficients
  x <- as.data.frame(mkgrid(ib))

  ### 2 * 1 
  predict(ib, newdata = x, coef = 2)

basefun documentation built on Feb. 14, 2020, 9:06 a.m.