Sample from the distribution of Pearson correlation indices between possible source-recipient couples given an infectious tree.

sampleCorrsPairs(tree, g, e, nSamples = 1000,
  sampTime = c("justAfterInfected", "bothAtInfection"), reg = F)

Arguments

tree

a phylo object with N tips.

g

numerical vector of length the number of nodes in the tree: the known viral genetic contributions at the tips and internal nodes.

e

numerical vector of length N: the known environmental deviations at the tips.

nSamples

: number of samples. Each sample corresponds to an assignment of the internal nodes of the tree with tip-labels and the correalation of the formed set of source-recipient phenotypes.

sampTime

: a character indicating how the phenotypes for the pairs shall be formed. Currently two possible values are supported : justAfterInfected - phenotypes after infection; bothAtInfection - the source and the recipient phenotypes are taken at the moment of infection.

reg

logical indicating if regression slopes instead of Pearson correlation indices should be returned, FALSE by default.

Value

a numerical vector of length nSamples