Top Description Inners Fields Constructors Methods
org.apache.poi.ss.formula.functions

public final Class LinearRegressionFunction

extends Fixed2ArgFunction
Class Inheritance
Imports
org.apache.poi.ss.formula.TwoDEval, org.apache.poi.ss.formula.eval.ErrorEval, .EvaluationException, .NumberEval, .RefEval, .ValueEval, org.apache.poi.ss.formula.functions.LookupUtils.ValueVector

Base class for linear regression functions. Calculates the linear regression line that is used to predict y values from x values
(http://introcs.cs.princeton.edu/java/97data/LinearRegression.java.html) Syntax:
INTERCEPT(arrayX, arrayY)

or SLOPE(arrayX, arrayY)

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
public static enum
private static class
private static class
private abstract static class

Field Summary

Modifier and TypeField and Description
private final LinearRegressionFunction.FUNCTION

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static LookupUtils.ValueVector
public ValueEval
private double
Inherited from org.apache.poi.ss.formula.functions.Fixed2ArgFunction:
evaluate

Field Detail

functionback to summary
private final LinearRegressionFunction.FUNCTION function

Constructor Detail

LinearRegressionFunctionback to summary
public LinearRegressionFunction(LinearRegressionFunction.FUNCTION function)

Method Detail

createValueVectorback to summary
private static LookupUtils.ValueVector createValueVector(ValueEval arg) throws EvaluationException
evaluateback to summary
public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0, ValueEval arg1)

Implements org.apache.poi.ss.formula.functions.Function2Arg.evaluate.

Doc from org.apache.poi.ss.formula.functions.Function2Arg.evaluate.

see Function#evaluate(ValueEval[], int, int)

evaluateInternalback to summary
private double evaluateInternal(LookupUtils.ValueVector x, LookupUtils.ValueVector y, int size) throws EvaluationException
org.apache.poi.ss.formula.functions back to summary

private final Class LinearRegressionFunction.AreaValueArray

extends ValueArray
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final TwoDEval
private final int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected ValueEval
Inherited from org.apache.poi.ss.formula.functions.LinearRegressionFunction.ValueArray:
getItemgetSize

Field Detail

_aeback to summary
private final TwoDEval _ae
_widthback to summary
private final int _width

Constructor Detail

AreaValueArrayback to summary
public AreaValueArray(TwoDEval ae)

Method Detail

getItemInternalback to summary
protected ValueEval getItemInternal(int index)

Implements abstract org.apache.poi.ss.formula.functions.LinearRegressionFunction.ValueArray.getItemInternal.

org.apache.poi.ss.formula.functions back to summary

public final Enum LinearRegressionFunction.FUNCTION

extends Enum<LinearRegressionFunction.FUNCTION>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final LinearRegressionFunction.FUNCTION
public static final LinearRegressionFunction.FUNCTION

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static LinearRegressionFunction.FUNCTION
public static LinearRegressionFunction.FUNCTION[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

INTERCEPTback to summary
public static final LinearRegressionFunction.FUNCTION INTERCEPT
SLOPEback to summary
public static final LinearRegressionFunction.FUNCTION SLOPE

Constructor Detail

FUNCTIONback to summary
private FUNCTION()

Method Detail

valueOfback to summary
public static LinearRegressionFunction.FUNCTION valueOf(String name)
valuesback to summary
public static LinearRegressionFunction.FUNCTION[] values()
org.apache.poi.ss.formula.functions back to summary

private final Class LinearRegressionFunction.RefValueArray

extends ValueArray
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final RefEval
private final int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected ValueEval
Inherited from org.apache.poi.ss.formula.functions.LinearRegressionFunction.ValueArray:
getItemgetSize

Field Detail

_refback to summary
private final RefEval _ref
_widthback to summary
private final int _width

Constructor Detail

RefValueArrayback to summary
public RefValueArray(RefEval ref)

Method Detail

getItemInternalback to summary
protected ValueEval getItemInternal(int index)

Implements abstract org.apache.poi.ss.formula.functions.LinearRegressionFunction.ValueArray.getItemInternal.

org.apache.poi.ss.formula.functions back to summary

private final Class LinearRegressionFunction.SingleCellValueArray

extends ValueArray
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final ValueEval

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected ValueEval
Inherited from org.apache.poi.ss.formula.functions.LinearRegressionFunction.ValueArray:
getItemgetSize

Field Detail

_valueback to summary
private final ValueEval _value

Constructor Detail

SingleCellValueArrayback to summary
public SingleCellValueArray(ValueEval value)

Method Detail

getItemInternalback to summary
protected ValueEval getItemInternal(int index)

Implements abstract org.apache.poi.ss.formula.functions.LinearRegressionFunction.ValueArray.getItemInternal.

org.apache.poi.ss.formula.functions back to summary

private abstract Class LinearRegressionFunction.ValueArray

extends Object
implements ValueVector
Class Inheritance
  • java.lang.Object
  • org.apache.poi.ss.formula.functions.LinearRegressionFunction.ValueArray
All Implemented Interfaces
org.apache.poi.ss.formula.functions.LookupUtils.ValueVector
Known Direct Subclasses
org.apache.poi.ss.formula.functions.LinearRegressionFunction.SingleCellValueArray, org.apache.poi.ss.formula.functions.LinearRegressionFunction.RefValueArray, org.apache.poi.ss.formula.functions.LinearRegressionFunction.AreaValueArray

Field Summary

Modifier and TypeField and Description
private final int

Constructor Summary

AccessConstructor and Description
protected
ValueArray(int size)

Method Summary

Modifier and TypeMethod and Description
public ValueEval
protected abstract ValueEval
getItemInternal(int index)

public final int
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_sizeback to summary
private final int _size

Constructor Detail

ValueArrayback to summary
protected ValueArray(int size)

Method Detail

getItemback to summary
public ValueEval getItem(int index)

Implements org.apache.poi.ss.formula.functions.LookupUtils.ValueVector.getItem.

Annotations
@Override
getItemInternalback to summary
protected abstract ValueEval getItemInternal(int index)
getSizeback to summary
public final int getSize()

Implements org.apache.poi.ss.formula.functions.LookupUtils.ValueVector.getSize.