predict.epplab: Calculates projections for a new Data Object

predict.epplabR Documentation

Calculates projections for a new Data Object

Description

Calculates the projections of a new data object onto the directions from an existing ebblab object.

Usage

## S3 method for class 'epplab'
predict(object, which = 1, data = NULL, ...)

Arguments

object

Object of class epplab.

which

Onto which direction should the new data be projected.

data

The new data object

...

Additional parameters

Details

The default projection direction is the direction with the best objective criterion. In case that no data is given to the function, the fitted scores for the original data will be returned.

Value

A matrix having in each column the projection onto the direction of a certain run and in each row the projected value.

Author(s)

Daniel Fischer

Examples


library(tourr)
data(olive)
res <- EPPlab(olive[,3:10], PPalg="PSO", PPindex="KurtosisMin", n.simu=10, maxiter=20)

newData <- matrix(rnorm(80), ncol=8)

# Projection on the best direction
predict(res, data=newData)

# Projection on the best 3 directions
predict(res, which=1:3, data=newData)

# Similar with function fitted() when no data is given:
predict(res)
fitted(res)


fischuu/REPPlab documentation built on April 19, 2023, 9:52 a.m.