PredictionEstParmFunc: Predicting using dirichl-gLV

View source: R/PredictionEstParmFunc.R

PredictionEstParmFuncR Documentation

Predicting using dirichl-gLV

Description

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

Usage

PredictionEstParmFunc(
  paramEstimadosFinal,
  EspecieMaxima,
  alpha,
  K,
  esperanza,
  Var,
  E,
  Tt
)

Arguments

paramEstimadosFinal

The estimate parameters. Vector equal to c(tau,as.vector( pam)) where:

  • pam Matrix. Each row has the parameters of each bacteria. Following our example, pam has the parameters placed as follows:

    r1 a11 a12
    r2 a21 a22
  • tau Number. Value of the tau parameter in the model

EspecieMaxima

Row in which the bacteria chosen as reference is in especie.This bacteria is used as reference in the alr transformation that the model does.

alpha

Matrix that contains at the row i the dirichlet parameter of the bacteria i at t=1,2,3,...,Tt.

K

Number. The function will calculate the value of the expected value and the variance at Tt and predict for the time points t=Tt+1,..,K. To predict all the time points available at the data we K=dim(especie.All)-1

esperanza

Matrix that contains at row i the expected value of the bacterial taxa of bacteria i at t=1,2,3,...,Tt-1.

Var

Matrix that contains at row i the variance of the bacterial taxa of bacteria i at t=1,2,3,...,Tt-1.

E

Number of bacteria available

Tt

Number of time points available

Details

The regression of this model, in an example with three bacteria, is defined by

r_{1}\cdot log(x_{1}(t)/x_{3}(t))+log(x_{1}(t)/x_{3}(t))\cdot [a_{11}\cdot log(x_{1}(t)/x_{3}(t))(t)+a_{12}\cdot log(x_{2}(t)/x_{3}(t))]

r_{2}\cdot log(x_{2}(t)/x_{3}(t))+log(x_{2}(t)/x_{3}(t))\cdot [a_{21}\cdot log(x_{1}(t)/x_{3}(t))(t)+a_{22}\cdot log(x_{2}(t)/x_{3}(t))]

Value

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=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=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=2,...,K. The bacteria are placed at the same order than in especies.

References

Creus-Martí, I. and Moya, A. and Santonja, F. J. (2018). A Statistical Model with a Lotka-Volterra Structure for Microbiota Data. Lucas Jodar, Juan Carlos Cortes and Luis Acedo, Modelling or engineering and human behavior 2018, Instituto Universitario de Matematica Multidisciplinar. ISBN: 978-84-09-07541-6

Examples


pam.ini=rbind(c(0.1,0.2,0.3),c(0.4,0.5,0.6))
paramEstimadosFinal=c(5, as.vector(pam.ini))
EspecieMaxima=3
alpha=cbind(c(2,2,3),c(1,1,3))
K=3
esperanza=cbind(c(0.2,0.3,0.5))
Var=cbind(c(0.2,0.3,0.5))
E=3
Tt=2

PredictionEstParmFunc(paramEstimadosFinal,EspecieMaxima, alpha,K,esperanza,Var,E,Tt )


CoDaLoMic documentation built on April 12, 2025, 2:18 a.m.