Data: A vector with the observations of the response variable
Matriz: The model design matrix
individuos: A numerical value indicating the number of individuals in the study
tiempos: A numerical value indicating the number of times observations were repeated
betai: A vector with the initial values of the vector of regressors
rhoi: A numerical value with the initial value of the correlation
beta1i: A numerical value with the shape parameter of a beta apriori distribution of rho
beta2i: A numerical value with the scaling parameter of a beta apriori distribution of rho
iteraciones: A numerical value with the number of iterations that will be applied the algorithm MCMC
burn: Number of iterations that are discarded from the chain
Returns
A dataframe with the mean, median and standard deviation of each parameter, A graph with the histograms and chains for the parameters that make up the variance matrix, as well as the selection criteria AIC, BIC and DIC
Gamerman, D. 1997. Sampling from the posterior distribution in generalized linear mixed models. Statistics and Computing, 7, 57-68
Cepeda, C and Gamerman, D. 2004. Bayesian modeling of joint regressions for the mean and covariance matrix. Biometrical journal, 46, 430-440.
Cepeda, C and Nuñez, A. 2007. Bayesian joint modelling of the mean and covariance structures for normal longitudinal data. SORT. 31, 181-200.
Nuñez A. and Zimmerman D. 2001. Modelación de datos longitudinales con estructuras de covarianza no estacionarias: Modelo de coeficientes aleatorios frente a modelos alternativos. Questio. 2001. 25.