predict.spls.wrap: Make predictions from an spls.wrap model

Description Usage Arguments Author(s) Examples

View source: R/predict.spls.wrap.R

Description

Makes predictions from an spls.wrap model

Usage

1
predict.spls.wrap(model, newx)

Arguments

model
newx

Author(s)

Wesley Brooks

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function (model, newx) 
{
    n = nrow(newx)
    p = length(model[["coef"]])
    b = matrix(model[["coef"]], nrow = p, ncol = 1)
    x = matrix(newx, nrow = n, ncol = p)
    return(x %*% b)
  }

wrbrooks/spls.wrap documentation built on May 4, 2019, 11:59 a.m.