predict.epplab | R Documentation |
Calculates the projections of a new data object onto the directions from an
existing ebblab
object.
## S3 method for class 'epplab'
predict(object, which = 1, data = NULL, ...)
object |
Object of class |
which |
Onto which direction should the new data be projected. |
data |
The new data object |
... |
Additional parameters |
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.
A matrix having in each column the projection onto the direction of a certain run and in each row the projected value.
Daniel Fischer
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.