Facemorph.Stats
Class WeightedPLS

java.lang.Object
  extended by Facemorph.Stats.PLSReducer
      extended by Facemorph.Stats.WeightedPLS
All Implemented Interfaces:
IniHandler, DataReducer, Regressor, StatisticalModel
Direct Known Subclasses:
WeightedPLS2

public class WeightedPLS
extends PLSReducer


Nested Class Summary
 
Nested classes/interfaces inherited from interface Facemorph.Stats.DataReducer
DataReducer.DataReducerInformation
 
Nested classes/interfaces inherited from interface Facemorph.Stats.Regressor
Regressor.RegressorException
 
Field Summary
protected  int[] mapping
           
protected  double[] wWeights
           
protected  double[] zWeights
           
 
Fields inherited from class Facemorph.Stats.PLSReducer
B, c, C, E, epsilon, F, maxComponents, maxIter, meanX, meanY, noComponents, p, P, q, R, stdX, stdY, t, T, targetDependentVariance, targetIndependentVariance, u, U, varX, varY, w, W, X, Y
 
Constructor Summary
WeightedPLS()
           
 
Method Summary
 int build()
           
 void calculateNewWeights(BigMat Fw, boolean[] preRemoved, double[] newWeights, boolean[] newRemoved)
           
static void main(java.lang.String[] args)
           
 BigMat reweight(BigMat mat, double[] weights)
           
 BigMat reweight(BigMat mat, double[] weights, double factor)
           
 boolean train(boolean stats)
          Perform multi-linear regression using the Ordinary Least Squares method.
 
Methods inherited from class Facemorph.Stats.PLSReducer
apply, center, getBasisMatrix, getEpsilon, getInputDimensions, getModelInformation, getModelInformation, getOutputDimensions, getSumSquaredResiduals, getTargetDependentVariance, getTargetIndpendentVariance, initialise, iterate, iterate, outputStatistics, outputStatistics, predict, print, read, read, reconstructDependent, reconstructDependent, reconstructIndependent, reconstructIndependent, reduceDependent, reduceDependent, reduceIndependent, reduceIndependent, setDependentData, setDependentData, setEpsilon, setIndependentData, setOutputDimensions, setTargetDependentVariance, setTargetIndependentVariance, setTargetKaiserGuttman, write, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

zWeights

protected double[] zWeights

wWeights

protected double[] wWeights

mapping

protected int[] mapping
Constructor Detail

WeightedPLS

public WeightedPLS()
Method Detail

train

public boolean train(boolean stats)
Description copied from interface: StatisticalModel
Perform multi-linear regression using the Ordinary Least Squares method. Solves y = XB + e using b = inv(X'X)X'y

Specified by:
train in interface StatisticalModel
Overrides:
train in class PLSReducer
Parameters:
stats - calculate values for statistical analysis
Returns:
true if the regression succeeds.

reweight

public BigMat reweight(BigMat mat,
                       double[] weights)

reweight

public BigMat reweight(BigMat mat,
                       double[] weights,
                       double factor)

build

public int build()
Overrides:
build in class PLSReducer

calculateNewWeights

public void calculateNewWeights(BigMat Fw,
                                boolean[] preRemoved,
                                double[] newWeights,
                                boolean[] newRemoved)

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException
Throws:
java.io.IOException