predict.epplab {REPPlab} | R 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 |
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)
[Package REPPlab version 0.9.6 Index]