Package pal.eval
Class ChiSquareValue
- java.lang.Object
-
- pal.eval.ChiSquareValue
-
- All Implemented Interfaces:
MultivariateFunction
public class ChiSquareValue extends java.lang.Object implements MultivariateFunction
computes chi-square value of a (parameterized) tree for its set of parameters (e.g., branch lengths) and a given distance matrix- Version:
- $Id: ChiSquareValue.java,v 1.14 2002/12/05 04:27:28 matt Exp $
- Author:
- Korbinian Strimmer
-
-
Constructor Summary
Constructors Constructor Description ChiSquareValue(DistanceMatrix m, boolean w)
initialization
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
compute()
compute (weighted) least-square value for current tree (fixed branch lengths) return chi-square valuedouble
evaluate(double[] params)
compute (weighted) least-squares valuedouble
getLowerBound(int n)
get lower bound of argument nint
getNumArguments()
get number of parameters in treeOrthogonalHints
getOrthogonalHints()
Tree
getTree()
Returns the (parameterized) tree of this likelihood value.double
getUpperBound(int n)
get upper bound of argument ndouble
optimiseParameters()
optimise parameters of a tree by minimising its chi-square value (tree must be a ParameterizedTree)double
optimiseParameters(MultivariateMinimum mm)
optimise parameters of a tree by minimising its chi-square value (tree must be a ParameterizedTree)void
setTree(Tree t)
define (parameterized) tree
-
-
-
Constructor Detail
-
ChiSquareValue
public ChiSquareValue(DistanceMatrix m, boolean w)
initialization- Parameters:
m
- distance matrixw
- determines whether weighted or unweighted chi-squares are computed
-
-
Method Detail
-
setTree
public void setTree(Tree t)
define (parameterized) tree- Parameters:
t
- tree
-
getTree
public Tree getTree()
Returns the (parameterized) tree of this likelihood value.
-
compute
public double compute()
compute (weighted) least-square value for current tree (fixed branch lengths) return chi-square value
-
optimiseParameters
public double optimiseParameters()
optimise parameters of a tree by minimising its chi-square value (tree must be a ParameterizedTree)- Returns:
- minimimum chi-square value
-
optimiseParameters
public double optimiseParameters(MultivariateMinimum mm)
optimise parameters of a tree by minimising its chi-square value (tree must be a ParameterizedTree)- Parameters:
mm
- optimiser for ParameterizedTree- Returns:
- minimum chi-square value
-
evaluate
public double evaluate(double[] params)
compute (weighted) least-squares value- Specified by:
evaluate
in interfaceMultivariateFunction
- Parameters:
params
- parameters (branch lengths) of the tree- Returns:
- function value
-
getNumArguments
public int getNumArguments()
get number of parameters in tree- Specified by:
getNumArguments
in interfaceMultivariateFunction
- Returns:
- number of parameters
-
getLowerBound
public double getLowerBound(int n)
Description copied from interface:MultivariateFunction
get lower bound of argument n- Specified by:
getLowerBound
in interfaceMultivariateFunction
- Parameters:
n
- argument number- Returns:
- lower bound
-
getUpperBound
public double getUpperBound(int n)
Description copied from interface:MultivariateFunction
get upper bound of argument n- Specified by:
getUpperBound
in interfaceMultivariateFunction
- Parameters:
n
- argument number- Returns:
- upper bound
-
getOrthogonalHints
public OrthogonalHints getOrthogonalHints()
- Specified by:
getOrthogonalHints
in interfaceMultivariateFunction
- Returns:
- null
-
-