FVectorPBmodeloPredi: Obtaining a vector with the covariates of the prediction

View source: R/FVectorPBmodeloPredi.R

FVectorPBmodeloPrediR Documentation

Obtaining a vector with the covariates of the prediction

Description

Calculates a vector with the covariates of the BPBM model in one time point.

Usage

FVectorPBmodeloPredi(NumSPBal, DemSPBal, v, MatrizPBmodelo)

Arguments

NumSPBal

List. The component i of the list has the number of the row of the matrix especie where the bacteria in the numerator of the principal balance i are placed.

DemSPBal

List. The component i of the list has the number of the row of the matrix especie where the bacteria in the denominator of the principal balance i are placed.

v

Vector. Vector with a coda composition. The bacteria ar in the same orden than the matrix especie

MatrizPBmodelo

the matrix that contains the covariates of the model. The first line es equal to 1 for all columns. The other rows contain the value of one SPBal at all time points. The selected principal balance of the row i+1 has at its numerator the bacteria placed in the rows NumSPBal[[i]] of the "especie". The selected principal balance of the row i+1 has at its denominator the bacteria placed in the rows DemSPBal[[i]] of the "especie".

Value

Returns a vector where the first component is a 1 and the following components have the values of the SPBal. The SPBal in the component i+1 has at its numerator the bacteria placed in the rows Num[[i]] of the especie. The SPBal of the component i+1 has at its denominator the bacteria placed in the rows Dem[[i]] of the especie.

References

Creus-Martí, I., Moya, A., Santonja, F. J. (2022). Bayesian hierarchical compositional models for analysing longitudinal abundance data from microbiome studies. Complexity, 2022.

Examples


v=c(0.1,0.1,0.2,0.3,0.3)
Num2<-list(3,c(3,5),1,c(3,5,4))
Dem2<-list(5,4,2,c(1,2))
MatrizPBmodelo=rbind(c(1,1,1,1),
                    c(-0.3,0.2,0.5,0.6),
                    c(-0.4,0.3,0.5,0.6),
                    c(0.5,0.3,0.2,0.7),
                    c(-0.2,0.9,0.2,0.1)   )

FVectorPBmodeloPredi(Num2,Dem2,v,MatrizPBmodelo)


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