design_matrix {BPRMeth} | R Documentation

## Generic function for creating design matrices

### Description

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

### Usage

    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

    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)

[Package BPRMeth version 1.18.0 Index]