expand: Basis Expansion

Description Usage Arguments Value Examples

View source: R/utils.R

Description

Basis Expansion

Usage

1
expand(x, basis)

Arguments

x

A context observation (scalar if using the legendre polynomial basis).

basis

A list of basis functions to be applied to the context observation.

Value

A vector where the j'th element is the j'th basis function applied to the context observation.

Examples

1
2
3
4
J <- 5
basis <- legendre_basis(J) # Orthogonal on [-1,1]
x <- runif(1,-1,1)
basis_expansion <- expand(x,basis)

dfcorbin/MABsim documentation built on April 26, 2020, 8:26 a.m.