View source: R/PredictionFBM.R
PredictionFBM | R Documentation |
This function calculates the expected value and variance of the bacteria at time point Tt
. Then, this function calculates the expected value and variance of the bacteria at time point t=(Tt
+1),...,K
PredictionFBM(
paramEstimadosFinal,
EspecieMaxima,
alpha,
K,
esperanza,
Var,
E,
Tt
)
paramEstimadosFinal |
The estimate parameters, in the following order: a11,a12,a13, a21, a22,a23, ...a(D-1)1,a(D-1)2,a(D-1)3,tau. Where D is the number of bacterial species present in the matrix |
EspecieMaxima |
Row in which the bacteria chosen as reference is in |
alpha |
Matrix that contains at the row i the Dirichlet parameter of the bacteria i at t=1,2,3,..., |
K |
Number. The function will calculate the value of the expected value and the variance at |
esperanza |
Matrix that contains at row i the expected value of the bacterial taxa of bacteria i at t=1,2,3,..., |
Var |
Matrix that contains at row i the variance of the bacterial taxa of bacteria i at t=1,2,3,..., |
E |
Number of bacteria available |
Tt |
Number of bacteria available |
The regression of this model is defined by
\mu_{it}=a_{i1}+a_{i2}\cdot\text{alr}(x_{i,(t-1)})+a_{i3}\cdot\text{Balance}(x_{i,(t-1)})\text{ for }i=1,\dots, D-1\text{ where } D \text{ is the number of bacteria}
Returns a list with:
ExpectedValue.All: Matrix. Matrix that contains at row i the expected value of the bacteria i at all time points t=1,2,...,K. The bacteria are placed at the same order than in especies
.
VarianceValue.All: Matrix. Matrix that contains at row i the variance of the bacteria i at all time points t=1,2,...,K. The bacteria are placed at the same order than in especies
.
DirichlerParam.All: Matrix. Matrix that contains at row i the dirichlet parameter of the bacteria i at all time points t=1,2,...,K. The bacteria are placed at the same order than in especies
.
Creus-MartÃ, I., Moya, A., Santonja, F. J. (2021). A Dirichlet autoregressive model for the analysis of microbiota time-series data. Complexity, 2021, 1-16.
Tt=2
E=3
tau=5
EspecieMaxima=3
K=3
parms11=c(0.1,0.2,0.3,0.4,0.5,0.6,tau)
alpha=cbind(c(1.726793,1.892901,1.380306),
c(1,1,3))
Expected=cbind(c(alpha[1,1]/tau, alpha[2,1]/tau, alpha[3,1]/tau ),
c(alpha[1,2]/tau,alpha[2,2]/tau,alpha[3,2]/tau))
Variance=cbind(c(0.03768101, 0.03920954, 0.03330857 ),
c( 0.03683242,0.02784883, 0.0413761 ))
Expected.final=Expected[,-2]
Variance.final=Variance[,-2]
PredictionFBM(parms11,EspecieMaxima, alpha,K,Expected.final,Variance.final,E,Tt )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.