|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.rit.compbio.phyl.LeastSquaresBranchLengths
public class LeastSquaresBranchLengths
Class LeastSquaresBranchLengths provides methods for computing least squares branch lengths in a DnaSequenceTree.
| Method Summary | |
|---|---|
static double |
solve(DnaSequenceTree tree,
Distance dcalc)
Find the least squares branch lengths for the given DNA sequence tree. |
static double |
squaredError(DnaSequenceTree tree,
Distance dcalc)
Compute the squared error in the given DNA sequence tree's branch lengths. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static double squaredError(DnaSequenceTree tree,
Distance dcalc)
This method computes the distance between each pair of DNA sequences using the given dcalc object (the "direct distance"); computes the distance between each pair of DNA sequences by adding up the branch lengths along the path through the tree between the sequences (the "tree distance"); and returns the sum of the squares of the differences between the direct distance and the tree distance for each pair of DNA sequences.
tree - DNA sequence tree.dcalc - Object to calculate distances between DNA sequences.
public static double solve(DnaSequenceTree tree,
Distance dcalc)
This method calculates the branch lengths such that the squared error, as defined in the squaredError() method, is minimized. Each node of the tree is associated with the calculated branch length. The squared error is returned.
This method uses a nonnegative linear least squares solver (class edu.rit.numeric.NonNegativeLeastSquares) to calculate the branch lengths. Thus, all branch lengths will be nonnegative; some may be 0.
tree - DNA sequence tree.dcalc - Object to calculate distances between DNA sequences.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||