design_matrix: Generic function for creating design matrices

Description Usage Arguments Value Author(s) See Also Examples

View source: R/design_matrix.R

Description

These functions call the appropriate methods depending on the class of the object obj to create RBF, polynomial or Fourier design matrices.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
design_matrix(obj, ...)

## Default S3 method:
design_matrix(obj, ...)

## S3 method for class 'polynomial'
design_matrix(obj, obs, ...)

## S3 method for class 'rbf'
design_matrix(obj, obs, ...)

## S3 method for class 'fourier'
design_matrix(obj, obs, ...)

Arguments

obj

A basis function object.

...

Additional parameters.

obs

A vector of observations.

Value

A design matrix object

Author(s)

C.A.Kapourani C.A.Kapourani@ed.ac.uk

See Also

create_basis, eval_functions

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
obj <- create_polynomial_object(M=2)
obs <- c(0,.2,.5)
poly <- design_matrix(obj, obs)

#----------------

obj <- create_rbf_object(M=2)
obs <- c(0,.2,.5)
rbf <- design_matrix(obj, obs)

#----------------

obj <- create_fourier_object(M=2)
obs <- c(0,.2,.5)
fourier <- design_matrix(obj, obs)

andreaskapou/BPRMeth documentation built on June 11, 2020, 10:49 p.m.