Fast approximate all-pairs kernel summation on weighted trees via centroid decomposition and sum-of-exponentials approximation.
Given a weighted tree T on n nodes with node values mu and a kernel K, computes
Phi(v) = sum_u K(d_T(v,u)) * mu(u) for all v
in O(r n log n) time instead of the naive O(n^2), where r is the number of exponential terms in a sum-of-exponentials (SOE) approximation of K.
For the Python prototype (optional):
cargo build --release
cargo run --release
This runs the full validation and benchmark suite in sequence:
The full run takes approximately 5-10 minutes. The correctness validation sections print PASS/FAIL for each test. All benchmarks use deterministic ChaCha8 RNG with fixed seeds for exact reproducibility.
src/
main.rs # Entry point: runs all validation and benchmarks
tree.rs # WeightedTree, random tree generator (Prufer sequence),
# path/star trees, all-pairs distances
kernels.rs # Kernel definitions (Gaussian, exponential, Matern, InvMQ),
# naive O(n^2) kernel sum
centroid.rs # CentroidDecomposition::build, tree_kernel_sum (core algorithm),
# single_exp_sum (r=1 wrapper)
soe.rs # SOE fitting: dictionary OMP (legacy) + sinc-quadrature
# (preferred). auto_fit_sinc for automatic fitting
soe_comparison.rs # Formal comparison: OMP vs sinc vs Braess-Hackbusch bounds
bench.rs # validate_correctness + run_benchmarks
phylo.rs # Phylogenetics OU demo on coalescent trees
newick.rs # Newick/Nexus tree file parsers
real_tree_bench.rs # Benchmarks on published mammal phylogenies
prediction.rs # Kernel prediction of mammal body mass (Nadaraya-Watson LOO)
data/
Fritz_mammal_tree.nwk # Fritz et al. (2009) mammal supertree, 5020 tips
Upham_mammal_5911sp_MCC.nex # Upham et al. (2019) MCC mammal tree, 5912 tips
PanTHERIA_WR05.txt # PanTHERIA mammal trait database (Jones et al. 2009)
py_prototype/ # Archived Python prototype (NumPy/SciPy)
tree.py # Same structure as Rust, used for initial development
kernels.py
centroid.py
test_correctness.py
paper/
paper.tex # Manuscript draft (LaTeX, article class)
TreeKernelSum.md # Full theory: problem statement, algorithm, proofs
RESULTS.md # All empirical results and benchmark data
Total: O(r n log n) time, O(n log n) space. For standard kernels, r = O(log(D/eps) log(1/eps)).
| Claim | Status |
|---|---|
| Single exponential exact via centroid decomposition | Machine-epsilon errors across all topologies |
| General kernels satisfy Theorem 1 error bound | Actual errors are 10-13% of bound |
| O(r n log n) scaling | Confirmed up to n=1M |
| Sinc-quadrature SOE achieves r=8 at eps=1e-8 | Confirmed for Gaussian, Matern-1.5, Matern-2.5, InvMQ on [0,50] |
3 commits
Rust
57.7%
TeX
29.1%
Python
13.2%
Fast approximate all-pairs kernel summation on weighted trees via centroid decomposition and sum-of-exponentials approximation.
Given a weighted tree T on n nodes with node values mu and a kernel K, computes
Phi(v) = sum_u K(d_T(v,u)) * mu(u) for all v
in O(r n log n) time instead of the naive O(n^2), where r is the number of exponential terms in a sum-of-exponentials (SOE) approximation of K.
For the Python prototype (optional):
cargo build --release
cargo run --release
This runs the full validation and benchmark suite in sequence:
The full run takes approximately 5-10 minutes. The correctness validation sections print PASS/FAIL for each test. All benchmarks use deterministic ChaCha8 RNG with fixed seeds for exact reproducibility.
src/
main.rs # Entry point: runs all validation and benchmarks
tree.rs # WeightedTree, random tree generator (Prufer sequence),
# path/star trees, all-pairs distances
kernels.rs # Kernel definitions (Gaussian, exponential, Matern, InvMQ),
# naive O(n^2) kernel sum
centroid.rs # CentroidDecomposition::build, tree_kernel_sum (core algorithm),
# single_exp_sum (r=1 wrapper)
soe.rs # SOE fitting: dictionary OMP (legacy) + sinc-quadrature
# (preferred). auto_fit_sinc for automatic fitting
soe_comparison.rs # Formal comparison: OMP vs sinc vs Braess-Hackbusch bounds
bench.rs # validate_correctness + run_benchmarks
phylo.rs # Phylogenetics OU demo on coalescent trees
newick.rs # Newick/Nexus tree file parsers
real_tree_bench.rs # Benchmarks on published mammal phylogenies
prediction.rs # Kernel prediction of mammal body mass (Nadaraya-Watson LOO)
data/
Fritz_mammal_tree.nwk # Fritz et al. (2009) mammal supertree, 5020 tips
Upham_mammal_5911sp_MCC.nex # Upham et al. (2019) MCC mammal tree, 5912 tips
PanTHERIA_WR05.txt # PanTHERIA mammal trait database (Jones et al. 2009)
py_prototype/ # Archived Python prototype (NumPy/SciPy)
tree.py # Same structure as Rust, used for initial development
kernels.py
centroid.py
test_correctness.py
paper/
paper.tex # Manuscript draft (LaTeX, article class)
TreeKernelSum.md # Full theory: problem statement, algorithm, proofs
RESULTS.md # All empirical results and benchmark data
Total: O(r n log n) time, O(n log n) space. For standard kernels, r = O(log(D/eps) log(1/eps)).
| Claim | Status |
|---|---|
| Single exponential exact via centroid decomposition | Machine-epsilon errors across all topologies |
| General kernels satisfy Theorem 1 error bound | Actual errors are 10-13% of bound |
| O(r n log n) scaling | Confirmed up to n=1M |
| Sinc-quadrature SOE achieves r=8 at eps=1e-8 | Confirmed for Gaussian, Matern-1.5, Matern-2.5, InvMQ on [0,50] |
3 commits
Rust
57.7%
TeX
29.1%
Python
13.2%