XresidualContrib: Generates the squared prediction error contributions and...

View source: R/XresidualContrib.R

XresidualContribR Documentation

Generates the squared prediction error contributions and contribution plot

Description

Generates the squared prediction error (SPE) contributions and graph both mvdareg and mvdapca objects.

Usage

XresidualContrib(object, ncomp = object$ncomp, obs1 = 1)

Arguments

object

an object of class mvdareg or mvdapca.

ncomp

the number of components to include in the SPE calculation.

obs1

the observaion in SPE assessment.

Details

XresidualContrib is used to generates the squared prediction error (SPE) contributions and graph for both PLS and PCA models. Only one observation at a time is supported.

Value

The output of XresidualContrib is a matrix of score contributions for a specified observation and the corresponding graph.

Author(s)

Nelson Lee Afanador (nelson.afanador@mvdalab.com)

References

MacGregor, Process Monitoring and Diagnosis by Multiblock PLS Methods, May 1994 Vol. 40, No. 5 AIChE Journal

Examples

data(Penta)
mod1 <- plsFit(log.RAI ~., scale = TRUE, data = Penta[, -1],
               ncomp = 2, validation = "loo")
XresidualContrib(mod1, ncomp = 2, obs1 = 3)

## Not run: 
#PCA Model
pc1 <- pcaFit(Penta[, -1], ncomp = 4)
XresidualContrib(pc1, ncomp = 3, obs1 = 3)

## End(Not run)

mvdalab documentation built on Oct. 6, 2022, 1:05 a.m.