source: branches/ali/GDE/PHYML20130708/phyml/src/stats.h

Last change on this file was 10307, checked in by aboeckma, 11 years ago

added most recent version of phyml

File size: 5.3 KB
Line 
1/*
2
3PhyML:  a program that  computes maximum likelihood phylogenies from
4DNA or AA homologous sequences.
5
6Copyright (C) Stephane Guindon. Oct 2003 onward.
7
8All parts of the source except where indicated are distributed under
9the GNU public licence. See http://www.opensource.org for details.
10
11*/
12
13#include <config.h>
14
15#ifndef STATS_H
16#define STATS_H
17
18#include "utilities.h"
19#include "free.h"
20#include "lk.h"
21#include "optimiz.h"
22#include "models.h"
23#include "eigen.h"
24
25
26phydbl *Covariance_Matrix(t_tree *tree);
27phydbl *Hessian(t_tree *tree);
28void   Recurr_Hessian(t_node *a, t_node *b, int plus_minus, phydbl *inc, phydbl *res, int *is_ok, t_tree *tree);
29phydbl stdnormal_inv(phydbl p);
30phydbl Uni();
31int    Rand_Int(int min, int max);
32phydbl Ahrensdietergamma(phydbl alpha);
33phydbl Rgamma(phydbl shape, phydbl scale);
34phydbl Rexp(phydbl lambda);
35phydbl Bico(int n, int k);
36phydbl Factln(int n);
37phydbl Gammln(phydbl xx);
38phydbl Pbinom(int N, int ni, phydbl p);
39phydbl LnGamma (phydbl alpha);
40phydbl IncompleteGamma(phydbl x, phydbl alpha, phydbl ln_gamma_alpha);
41phydbl PointChi2 (phydbl prob, phydbl v);
42phydbl Bivariate_Normal_Density(phydbl x, phydbl y, phydbl mux, phydbl muy, phydbl sdx, phydbl sdy, phydbl rho);
43phydbl PointNormal (phydbl prob);
44int    DiscreteGamma (phydbl freqK[], phydbl rK[],phydbl alfa, phydbl beta, int K, int median);
45phydbl Pnorm(phydbl x, phydbl mean, phydbl var);
46phydbl Dnorm_Moments(phydbl x, phydbl mean, phydbl var);
47phydbl Dnorm(phydbl x, phydbl mean, phydbl sd);
48phydbl Pgamma(phydbl x, phydbl shape, phydbl scale);
49phydbl Dgamma_Moments(phydbl x, phydbl mean, phydbl var);
50phydbl Dgamma(phydbl x, phydbl shape, phydbl scale);
51phydbl LnFact(int n);
52int    Choose(int n, int k);
53phydbl Ppois(phydbl x, phydbl param);
54phydbl Dexp(phydbl x, phydbl param);
55phydbl Dpois(phydbl x, phydbl param);
56phydbl Rand_Normal_Deviate(phydbl mean, phydbl sd);
57phydbl Rnorm(phydbl mean, phydbl sd);
58phydbl *Rnorm_Multid(phydbl *mu, phydbl *cov, int dim);
59phydbl Rnorm_Trunc(phydbl mean, phydbl sd, phydbl min, phydbl max, int *err);
60phydbl *Rnorm_Multid_Trunc(phydbl *mean, phydbl *cov, phydbl *min, phydbl *max, int dim);
61phydbl *Hessian_Log(t_tree *tree);
62void Recurr_Hessian_Log(t_node *a, t_node *d, int plus_minus, phydbl *inc, phydbl *res, int *is_ok, t_tree *tree);
63phydbl Log_Det(int *is_ok, t_tree *tree);
64phydbl Dnorm_Trunc(phydbl x, phydbl mean, phydbl sd, phydbl lo, phydbl up);
65phydbl Normal_Trunc_Mean(phydbl mu, phydbl sd, phydbl min, phydbl max);
66phydbl Constraint_Normal_Trunc_Mean(phydbl wanted_mu, phydbl sd, phydbl min, phydbl max);
67phydbl Dnorm_Multi(phydbl *x, phydbl *mu, phydbl *cov, int size, int _log);
68phydbl Dnorm_Multi_Given_InvCov_Det(phydbl *x, phydbl *mu, phydbl *invcov, phydbl det, int size, int _log);
69phydbl Prop_Log_Dnorm_Multi_Given_InvCov_Det(phydbl *x, phydbl *mu, phydbl *invcov, phydbl det, int size);
70phydbl Log_Dnorm(phydbl x, phydbl mean, phydbl sd, int *err);
71phydbl tt800();
72phydbl Pnorm_Ihaka_Derived_From_Cody(phydbl x);
73int Matinv(phydbl *x, int n, int m, int verbose);
74phydbl *Matrix_Mult(phydbl *A, phydbl *B, int nra, int nca, int nrb, int ncb);
75phydbl *Matrix_Transpose(phydbl *A, int dim);
76void Normal_Conditional(phydbl *mu, phydbl *cov, phydbl *a, int n, short int *is_1, int n1, phydbl *cond_mu, phydbl *cond_var);
77void Normal_Conditional_Unsorted(phydbl *mu, phydbl *cov, phydbl *a, int n, short int *is_1, int n1, phydbl *cond_mu, phydbl *cond_cov);
78phydbl Matrix_Det(phydbl *A, int size, int _log);
79void Get_Reg_Coeff(phydbl *mu, phydbl *cov, phydbl *a, int n, short int *is_1, int n1, phydbl *reg_coeff);
80phydbl Rnorm_Trunc_Inverse(phydbl mean, phydbl sd, phydbl min, phydbl max, int *error);
81phydbl Norm_Trunc_Sd(phydbl mu, phydbl sd, phydbl a, phydbl b);
82phydbl Norm_Trunc_Mean(phydbl mu, phydbl sd, phydbl a, phydbl b);
83int Norm_Trunc_Mean_Sd(phydbl mu, phydbl sd, phydbl a, phydbl b, phydbl *trunc_mu, phydbl *trunc_sd);
84phydbl Log_Dnorm_Trunc(phydbl x, phydbl mean, phydbl sd, phydbl lo, phydbl up, int *err);
85phydbl  Pnorm_Marsaglia(phydbl x);
86int Iter_Matinv(phydbl *x, int n, int m, int verbose);
87phydbl Dorder_Unif(phydbl x, int r, int n, phydbl min, phydbl max);
88phydbl Covariance(phydbl *x, phydbl *y, int n);
89phydbl *Rnorm_Multid_Trunc_Constraint(phydbl *mu, phydbl *cov, phydbl *min, phydbl *max, phydbl *lambda, phydbl k, phydbl *res, int len);
90phydbl *Gradient(t_tree *tree);
91phydbl *Hessian_Seo(t_tree *tree);
92void Integrated_Brownian_Bridge_Moments(phydbl x_beg, phydbl x_end, 
93                                        phydbl y_beg, phydbl y_end, 
94                                        phydbl sd, phydbl *mean, phydbl *var);
95void PMat_MGF_Gamma(phydbl *Pij, phydbl shape, phydbl scale, phydbl scaling_fact, t_mod *mod);
96void Integrated_Geometric_Brownian_Bridge_Moments(phydbl T, phydbl A, phydbl B, phydbl u, phydbl *mean, phydbl *var);
97void Integrated_Geometric_Brownian_Bridge_Mean(phydbl T, phydbl A, phydbl B, phydbl u, phydbl *mean);
98void Integrated_Geometric_Brownian_Bridge_Var(phydbl T, phydbl A, phydbl B, phydbl u, phydbl *mean);
99int Sample_i_With_Proba_pi(phydbl *pi, int len);
100phydbl Quantile(phydbl *x, int len, phydbl p);
101phydbl Prob(phydbl *x, int len, phydbl z);
102phydbl Inverse_Truncated_Normal(phydbl y, phydbl mu, phydbl sigma, phydbl lim_inf, phydbl lim_sup);
103phydbl Progressive_EXP(phydbl x);
104int *Permutate(int len);
105phydbl Mantel(phydbl *x, phydbl *y, int nrow, int ncol);
106phydbl Weighted_Mean(phydbl *x, phydbl *w, int l);
107
108#endif
Note: See TracBrowser for help on using the repository browser.