ProcessAE: Process the output of 'EstimateCCM'

View source: R/ProcessAE.R

ProcessAER Documentation

Process the output of 'EstimateCCM'

Description

Calculate the convergence rate and standard errors.

Usage

ProcessAE(aE)

Arguments

aE

a list returned by 'EstimateCCM()'.

Value

a list with following elements:

  • rate: rate of converge. If value is too large (e.g. >300), consider increasing the tuning parameter \lambda.

  • hessianSE: estimated standard errors using Hessian matrix.

Examples

set.seed(123)
t <- rtree(100)
d <- TreeToDend(t)

# setting random parameters for a pair without interaction
n <- 2
alpha <- runif(n, -0.1, 0.1)
B <- matrix(0, n, n)
diag(B) <- runif(n, -0.1, 0.1)
B[1,2] <- B[2,1] <- 0 # independent pair

simDF <- SimulateProfiles(t, alpha, B)
ProfilePlot(simDF, d) # plot the profiles
aE <- EstimateCCM(profiles = simDF, phytree=t)
estSE <- ProcessAE(aE)$hessianSE
# testing if there is significant interaction
# p value for Ha: \eqn{\beta != 0}
sigScore <- aE$nlm.par[5] / estSE[5]
print(2*(1 - pnorm(abs(sigScore))))

# simulate a pair with interaction
B[1,2]<-B[2,1] <- 0.5 # set an interaction between genes
simDF <- SimulateProfiles(t, alpha, B)
ProfilePlot(simDF, d)
aE <- EstimateCCM(profiles = simDF, phytree=t)
estSE <- ProcessAE(aE)$hessianSE
# testing if there is significant interaction
# p value for Ha: \eqn{\beta != 0}
sigScore <- aE$nlm.par[5] / estSE[5]
print(2*(1 - pnorm(abs(sigScore))))


beiko-lab/evolCCM documentation built on Feb. 26, 2024, 5:21 p.m.