Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PCR

Creates new PCR (Principal component regression)

param predictor

matrix with predictor variables. (Each column is an array)

param response

matrix with response variables. (Each column is an array)

param pcaWeight

Weight to choose the principal components. It refers to the weight that components must sum with each other (in percent) to perform the regression.

param intercept

Intercept

Hierarchy

  • PCR

Index

Constructors

  • new PCR(predictor: number[][] | Matrix, response: number[][] | Matrix, options?: PCROptions): PCR
  • Parameters

    • predictor: number[][] | Matrix
    • response: number[][] | Matrix
    • options: PCROptions = {}

    Returns PCR

Properties

coefficients: Matrix
intercept: boolean
loadingsData: { component: number[]; componentNumber: number; evalues: number; weight: number }[]
pcaWeight: number
scores: Matrix
statistics: Statistics
xMedia?: number[]
yFittedValues: Matrix

Methods

  • getCoefficients(): Matrix
  • Returns the regression coefficients

    Returns Matrix

  • getFittedValuesY(): Matrix
  • Returns fitted values of Y

    Returns Matrix

  • getLoadingsdata(): { component: number[]; componentNumber: number; evalues: number; weight: number }[]
  • Returns the scores for principal components

    Returns { component: number[]; componentNumber: number; evalues: number; weight: number }[]

  • getScores(): Matrix
  • Returns the number of principal components used

    Returns Matrix

  • predict(x: number[]): number[]
  • Predict y-values for a given x

    Parameters

    • x: number[]

    Returns number[]