Type: | Package |
Title: | Negative Binomial and Beta Binomial Bayesian Regression Models |
License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
Version: | 1.0 |
Date: | 2016-11-15 |
Author: | Edilberto Cepeda-Cuervo, Maria Victoria Cifuentes-Amado and Margarita Marin |
Maintainer: | Edilberto Cepeda <ecepedac@unal.edu.co> |
Depends: | R (≥ 3.1.1), mvtnorm, Matrix, boot |
Description: | The Negative Binomial regression with mean and shape modeling and mean and variance modeling and Beta Binomial regression with mean and dispersion modeling. |
NeedsCompilation: | no |
Packaged: | 2016-11-15 20:15:15 UTC; margarita |
Repository: | CRAN |
Date/Publication: | 2016-11-17 08:27:30 |
NegBinBetaBinreg
Description
Function to estimate a Negative Binomial regression models with mean and shape (or variance) regression structures, and Beta Binomial regression with mean and dispersion regression structures.
Details
Package: | NegBinBetaBinreg |
Type: | Package |
Version: | 1.0 |
Date: | 2016-10-8 |
License: | GPL-2 |
LazyLoad: | yes |
Author(s)
Edilberto Cepeda-Cuervo ecepedac@unal.edu.co, Maria Victoria Cifuentes-Amado mvcifuentesa@unal.edu.co, Margarita Marin mmarinj@unal.edu.co
NegBinBetaBinreg
Description
Function to estimate a Negative Binomial regression models with mean and shape (or variance) regression structures, and Beta Binomial regression with mean and dispersion regression structures.
Usage
NegBinBetaBinreg(y,x,z,nsim,bpri,Bpri,
gpri,Gpri,burn,jump,bini,gini,model,m,ni,graph1,graph2)
Arguments
y |
object of class matrix or vector, with the dependent variable. |
x |
object of class matrix, with the variables for modelling the mean. |
z |
object of class matrix, with the variables for modelling the shape, variance or dispersion. |
nsim |
a number that indicate the number of iterations. |
bpri |
a vector with the prior values of beta. |
Bpri |
a matrix with the prior values of the variance of beta. |
gpri |
a vector with the prior values of gamma. |
Gpri |
a matrix with the prior values of the variance of gamma. |
burn |
a proportion that indicate the number of iterations to be burn at the beginning of the chain. |
jump |
a number that indicate the distance between samples of the autocorrelated the chain, to be excluded from the final chain. |
bini |
a vector with the initial values of beta. |
gini |
a vector with the initial values of gamma. |
model |
it indicates the model that will be used. By default, is the Beta Binomial model (BB), but it could also be the Negative Binomial with mean and shape (NB1) or the Negative Binomial with mean and variance (NB2). |
m |
Is positive integer that In the Beta Binomial model indicates the number of trials. By default, is the number of data |
ni |
Is a vector of positive integer that In the Beta Binomial model indicates the number of trials to each individual. By default, is a vector of m |
graph1 |
if it is TRUE present the graph of the chains without jump and burn. |
graph2 |
if it is TRUE present the graph of the chains with jump and burn. |
Details
The Bayesian Negative Binomial regression allow the joint modelling of mean and shape or variance of a negative binomial distributed variable, as is proposed in Cepeda (2001), with exponential link for the mean and the shape or variance. The Bayesian Beta Binomial regression allow the joint modelling of mean and precision of a beta binomial distributed variable, as is proposed in Cepeda (2001), with logit link for the mean and exponential link for the precision.
Value
object of class NegBinBetaBinreg with:
coefficients |
object of class matrix with the estimated coefficients of beta and gamma. |
desv |
object of class matrix with the estimated desviations of beta and gamma. |
interv |
object of class matrix with the estimated confidence intervals of beta and gamma. |
fitted.values |
object of class matrix with the fitted values of y. |
residuals |
object of class matrix with the residuals of the regression. |
estresiduals |
object of class matrix with the standardized residuals of the regression. |
beta.mcmc |
object of class matrix with the complete chains for beta. |
gamma.mcmc |
object of class matrix with the complete chains for gamma. |
beta.mcmc.short |
object of class matrix with the chains for beta after the burned process. |
gamma.mcmc.short |
object of class matrix with the chains for gamma after the burned process. |
aceptbeta |
object of class integer with the acceptance rate for the beta values. |
aceptgamma |
object of class integer with the acceptance rate for the gamma values. |
call |
Call. |
Author(s)
Edilberto Cepeda-Cuervo ecepedac@unal.edu.co, Maria Victoria Cifuentes-Amado mvcifuentesa@unal.edu.co, Margarita Marin mmarinj@unal.edu.co
References
1. Cepeda C. E. (2001). Modelagem da variabilidade em modelos lineares generalizados. Unpublished Ph.D. tesis. Instituto de Matematicas. Universidade Federal do Rio do Janeiro. //http://www.docentes.unal.edu.co/ecepedac/docs/MODELAGEM20DA20VARIABILIDADE.pdf. http://www.bdigital.unal.edu.co/9394/. 2.Cepeda, E. C. and Gamerman D. (2005). Bayesian Methodology for modeling parameters in the two-parameter exponential family. Estadistica 57, 93 105. // 3.Cepeda, E. and Garrido, L. (2011). Bayesian beta regression models: joint mean and precision modeling. Universidad Nacional // 4.Cepeda, E. and Migon, H. and Garrido, L. and Achcar, J. (2012) Generalized Linear models with random effects in the two parameter exponential family. Journal of Statistical Computation and Simulation. 1, 1 13. // 5.Cepeda-Cuervo, E. and Cifuentes-Amado, V. (2016) Double generalized beta-binomial and negative binomial regression. To appear.
Examples
rm(list=ls(all=TRUE))
Y<-c(6,6,9,13,23,25,32,53,54,5,5,11,17,19,2,8,13,14,20,47,
48,60,81,6,17,67,0,0,2,7,11,12,0,0,5,5,5,11,17,3,4,22,
30,36,0,1,5,7,8,16,27,25,10,11,20,33,0,1,5,5,5,5,5,7,7,11,15,5,6,6,7,14
)
y <- Y <- Y[1:68]
x0<-rep(1,times=68)
x2<-c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
)
x3<-c(0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,
0,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,0,0,0,1,1,1,1,1,1,1,
0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1
)
x<-cbind(x0,x2,x3)
z0<-rep(1,times=68)
z<-cbind(z0,x2)
Bpri=diag(rep(1,3))
bpri=rep(0,3)
Gpri=diag(rep(1,2))
gpri=rep(0,2)
Bini=diag(rep(1,3))
bini=c(3,-1,-0.5)
Gini=diag(rep(1,2))
gini=c(3,-1)
nsim = 300
burn <- 0.1
jump <- 5
model <- "NB1"
m <- 360
ni <- NULL
re<- NegBinBetaBinregEst (y,x,z,nsim,bpri,
Bpri,gpri,Gpri,burn,jump,bini,gini,
model,m,ni,graph1=FALSE,graph2=FALSE)
summary(re)
Negative Binomial and Beta Binomial regression
Description
Function to estimate a Negative Binomial regression models with mean and shape (or variance) regression structures, and Beta Binomial regression with mean and dispersion regression structures.
Usage
NegBinBetaBinregEst(y,x,z,nsim,bpri,Bpri,
gpri,Gpri,burn,jump,bini,gini,model,m,ni,graph1,graph2)
Arguments
y |
object of class matrix or vector, with the dependent variable. |
x |
object of class matrix, with the variables for modelling the mean. |
z |
object of class matrix, with the variables for modelling the shape, variance or dispersion. |
nsim |
a number that indicate the number of iterations. |
bpri |
a vector with the prior values of beta. |
Bpri |
a matrix with the prior values of the variance of beta. |
gpri |
a vector with the prior values of gamma. |
Gpri |
a matrix with the prior values of the variance of gamma. |
burn |
a proportion that indicate the number of iterations to be burn at the beginning of the chain. |
jump |
a number that indicate the distance between samples of the autocorrelated the chain, to be excluded from the final chain. |
bini |
a vector with the initial values of beta. |
gini |
a vector with the initial values of gamma. |
model |
it indicates the model that will be used. By default, is the Beta Binomial model (BB), but it could also be the Negative Binomial with mean and shape (NB1) or the Negative Binomial with mean and variance (NB2). |
m |
Is positive integer that In the Beta Binomial model indicates the number of trials. By default, is the number of data |
ni |
Is a vector of positive integer that In the Beta Binomial model indicates the number of trials to each individual. By default, is a vector of m |
graph1 |
if it is TRUE present the graph of the chains without jump and burn. |
graph2 |
if it is TRUE present the graph of the chains with jump and burn. |
Details
The Bayesian Negative Binomial regression allow the joint modelling of mean and shape or variance of a negative binomial distributed variable, as is proposed in Cepeda (2001), with exponential link for the mean and the shape or variance. The Bayesian Beta Binomial regression allow the joint modelling of mean and precision of a beta binomial distributed variable, as is proposed in Cepeda (2001), with logit link for the mean and exponential link for the precision.
Value
object of class bayesbetareg
with the following:
Bestimado |
object of class matrix with the estimated coefficients of beta |
Gammaest |
object of class matrix with the estimated coefficients of gamma |
X |
object of class matrix, with the variables for modelling the mean |
Z |
object of class matrix, with the variables for modelling the shape, variance or dispersion. |
DesvBeta |
object of class matrix with the estimated desviations of beta |
DesvGamma |
object of class matrix with the estimated desviations of gamma |
B |
object of class matrix with the B values of the confidence intervals for beta |
G |
object of class matrix with the G values of the confidence intervals for gamma |
yestimado |
object of class matrix with the fitted values of y |
residuales |
object of class matrix with the residuals of the regression |
residuales |
object of class matrix with the standardized residuals of the regression |
beta.mcmc |
object of class matrix with the complete chains for beta |
gamma.mcmc |
object of class matrix with the complete chains for gamma |
beta.mcmc.auto |
object of class matrix with the chains for beta after the burned process |
gamma.mcmc.auto |
object of class matrix with the chains for gamma after the burned process |
aceptbeta |
object of class matrix with the acceptance rate for the betas |
aceptgamma |
object of class matrix with the acceptance rate for the gammas |
Author(s)
Edilberto Cepeda-Cuervo ecepedac@unal.edu.co, Maria Victoria Cifuentes-Amado mvcifuentesa@unal.edu.co, Margarita Marin mmarinj@unal.edu.co
References
1. Cepeda C. E. (2001). Modelagem da variabilidade em modelos lineares generalizados. Unpublished Ph.D. tesis. Instituto de Matematicas. Universidade Federal do Rio do Janeiro. //http://www.docentes.unal.edu.co/ecepedac/docs/MODELAGEM20DA20VARIABILIDADE.pdf. http://www.bdigital.unal.edu.co/9394/. 2.Cepeda, E. C. and Gamerman D. (2005). Bayesian Methodology for modeling parameters in the two-parameter exponential family. Estadistica 57, 93 105. // 3.Cepeda, E. and Garrido, L. (2011). Bayesian beta regression models: joint mean and precision modeling. Universidad Nacional // 4.Cepeda, E. and Migon, H. and Garrido, L. and Achcar, J. (2012) Generalized Linear models with random effects in the two parameter exponential family. Journal of Statistical Computation and Simulation. 1, 1 13. // 5.Cepeda-Cuervo, E. and Cifuentes-Amado, V. (2016) Double generalized beta-binomial and negative binomial regression. To appear.
criteria for comparison the Bayesian Negative Binomial regression models with mean and shape (or variance) regression structures, and Beta Binomial regression with mean and dispersion regression structures.
Description
Performs the comparison criterias for the Bayesian Negative Binomial regression models with mean and shape (or variance) regression structures, and Beta Binomial regression with mean and dispersion regression structures.
Usage
criteria(objeto)
Arguments
objeto |
object of class NegBinBetaBinreg |
Details
This function calculate the information criteria for a Bayesian Negative Binomial regression with mean and shape modeling and mean and variance modeling and Beta Binomial regression with mean and dispersion modeling.
Value
AIC |
the AiC criteria |
BIC |
the BIC criteria |
Author(s)
Edilberto Cepeda-Cuervo ecepedac@unal.edu.co, Maria Victoria Cifuentes-Amado mvcifuentesa@unal.edu.co, Margarita Marin mmarinj@unal.edu.co
Posterior value of beta
Description
Propose a value for posterior distribution of the beta parameter
Usage
dpostb(y,x,z,betas,gammas,bpri,Bpri,model,m)
Arguments
y |
object of class matrix, with the dependent variable |
x |
object of class matrix, with the variables for modelling the mean |
z |
object of class matrix, with the variables for modelling the variance |
betas |
a vector with the previous proposal beta parameters |
gammas |
a vector with the previous proposal gamma parameters |
bpri |
a vector with the initial values of beta |
Bpri |
a matrix with the initial values of the variance of beta |
model |
it indicates the model that will be used. By default, is the Beta Binomial model (BB), but it could also be the Negative Binomial with mean and shape (NB1) or the Negative Binomial with mean and variance (NB2). |
m |
It is positive integer that In the Beta Binomial model indicates the number of trials. By default, is the number of data |
Details
Generate a proposal for the beta parameter according to the model proposed by Cepeda and Gamerman(2005).
Value
value |
a matrix with the proposal for beta |
Author(s)
Edilberto Cepeda-Cuervo ecepedac@unal.edu.co, Maria Victoria Cifuentes-Amado mvcifuentesa@unal.edu.co, Margarita Marin mmarinj@unal.edu.co
References
1. Cepeda C. E. (2001). Modelagem da variabilidade em modelos lineares generalizados. Unpublished Ph.D. tesis. Instituto de Matematicas. Universidade Federal do Rio do Janeiro. //http://www.docentes.unal.edu.co/ecepedac/docs/MODELAGEM20DA20VARIABILIDADE.pdf. http://www.bdigital.unal.edu.co/9394/. 2.Cepeda, E. C. and Gamerman D. (2005). Bayesian Methodology for modeling parameters in the two-parameter exponential family. Estadistica 57, 93 105. // 3.Cepeda, E. and Garrido, L. (2011). Bayesian beta regression models: joint mean and precision modeling. Universidad Nacional // 4.Cepeda, E. and Migon, H. and Garrido, L. and Achcar, J. (2012) Generalized Linear models with random effects in the two parameter exponential family. Journal of Statistical Computation and Simulation. 1, 1 13. // 5.Cepeda-Cuervo, E. and Cifuentes-Amado, V. (2016) Double generalized beta-binomial and negative binomial regression. To appear.
Posterior value of gamma
Description
Propose a value for posterior distribution of the gamma parameter
Usage
dpostg(y,x,z,betas,gammas,gpri,Gpri,model,m)
Arguments
y |
object of class matrix, with the dependent variable |
x |
object of class matrix, with the variables for modelling the mean |
z |
object of class matrix, with the variables for modelling the variance |
betas |
a vector with the previous proposal beta parameters |
gammas |
a vector with the previous proposal gamma parameters |
gpri |
a vector with the initial values of gamma |
Gpri |
a matrix with the initial values of the variance of gamma |
model |
it indicates the model that will be used. By default, is the Beta Binomial model (BB), but it could also be the Negative Binomial with mean and shape (NB1) or the Negative Binomial with mean and variance (NB2). |
m |
It is positive integer that In the Beta Binomial model indicates the number of trials. By default, is the number of data |
Details
Generate a proposal for the beta parameter according to the model proposed by Cepeda(2001) and Cepeda and Gamerman(2005).
Value
value |
a integer with the value of the posterior density for gamma |
Author(s)
Edilberto Cepeda-Cuervo ecepedac@unal.edu.co, Maria Victoria Cifuentes-Amado mvcifuentesa@unal.edu.co, Margarita Marin mmarinj@unal.edu.co
References
1. Cepeda C. E. (2001). Modelagem da variabilidade em modelos lineares generalizados. Unpublished Ph.D. tesis. Instituto de Matematicas. Universidade Federal do Rio do Janeiro. //http://www.docentes.unal.edu.co/ecepedac/docs/MODELAGEM20DA20VARIABILIDADE.pdf. http://www.bdigital.unal.edu.co/9394/. 2.Cepeda, E. C. and Gamerman D. (2005). Bayesian Methodology for modeling parameters in the two-parameter exponential family. Estadistica 57, 93 105. // 3.Cepeda, E. and Garrido, L. (2011). Bayesian beta regression models: joint mean and precision modeling. Universidad Nacional // 4.Cepeda, E. and Migon, H. and Garrido, L. and Achcar, J. (2012) Generalized Linear models with random effects in the two parameter exponential family. Journal of Statistical Computation and Simulation. 1, 1 13. // 5.Cepeda-Cuervo, E. and Cifuentes-Amado, V. (2016) Double generalized beta-binomial and negative binomial regression. To appear.
the probability of a gamma parameter from the probability density funcion defined by old parameters
Description
evaluate the probability of a gamma parameter from the probability density function defined by old parameters
Usage
gammakernel(y, x, z,betas.ini,gammas.now,gammas.old,gpri,Gpri,model,m,ni)
Arguments
y |
object of class matrix, with the dependent variable |
x |
object of class matrix, with the variables for modelling the mean |
z |
object of class matrix, with the variables for modelling the variance |
betas.ini |
a vector with the beta that define the old p.d.f |
gammas.now |
a vector with the gamma parameter - new parameters - to evaluate in the old p.d.f |
gammas.old |
a vector with the gamma that define the old p.d.f |
gpri |
a vector with the initial values of gamma |
Gpri |
a matrix with the initial values of the variance of gamma |
model |
it indicates the model that will be used. By default, is the Beta Binomial model (BB), but it could also be the Negative Binomial with mean and shape (NB1) or the Negative Binomial with mean and variance (NB2). |
m |
It is positive integer that In the Beta Binomial model indicates the number of trials. By default, is the number of data |
ni |
It is a vector of positive integer that In the Beta Binomial model indicates the number of trials to each individual. By default, is a vector of m |
Details
Evaluate the probability of a gamma parameter from the probability density function defined by old parameters, according with the model proposed by Cepeda(2001) and Cepeda and Gamerman(2005).
Value
value |
a vector with the probability for the gamma parameter from the probability density function defined by old parameters |
Author(s)
Edilberto Cepeda-Cuervo ecepedac@unal.edu.co, Maria Victoria Cifuentes-Amado mvcifuentesa@unal.edu.co, Margarita Marin mmarinj@unal.edu.co
References
1. Cepeda C. E. (2001). Modelagem da variabilidade em modelos lineares generalizados. Unpublished Ph.D. tesis. Instituto de Matematicas. Universidade Federal do Rio do Janeiro. //http://www.docentes.unal.edu.co/ecepedac/docs/MODELAGEM20DA20VARIABILIDADE.pdf. http://www.bdigital.unal.edu.co/9394/. 2.Cepeda, E. C. and Gamerman D. (2005). Bayesian Methodology for modeling parameters in the two-parameter exponential family. Estadistica 57, 93 105. // 3.Cepeda, E. and Garrido, L. (2011). Bayesian beta regression models: joint mean and precision modeling. Universidad Nacional // 4.Cepeda, E. and Migon, H. and Garrido, L. and Achcar, J. (2012) Generalized Linear models with random effects in the two parameter exponential family. Journal of Statistical Computation and Simulation. 1, 1 13. // 5.Cepeda-Cuervo, E. and Cifuentes-Amado, V. (2016) Double generalized beta-binomial and negative binomial regression. To appear.
A proposal for gamma parameter
Description
Propose a value for the gamma parameter
Usage
gammaproposal(y, x, z, betas.ini,gammas.ini,gpri,Gpri,model,m,ni)
Arguments
y |
object of class matrix, with the dependent variable |
x |
object of class matrix, with the variables for modelling the mean |
z |
object of class matrix, with the variables for modelling the variance |
betas.ini |
a vector with the previous proposal beta parameters |
gammas.ini |
a vector with the previous proposal gamma parameters |
gpri |
a vector with the initial values of gamma |
Gpri |
a matrix with the initial values of the variance of gamma |
model |
it indicates the model that will be used. By default, is the Beta Binomial model (BB), but it could also be the Negative Binomial with mean and shape (NB1) or the Negative Binomial with mean and variance (NB2). |
m |
It is positive integer that In the Beta Binomial model indicates the number of trials. By default, is the number of data |
ni |
It is a vector of positive integer that In the Beta Binomial model indicates the number of trials to each individual. By default, is a vector of m |
Details
Generate a proposal for the gamma parameter according to the model proposed by Cepeda(2001) and Cepeda and Gamerman(2005).
Value
value |
a number with the proposal for the gamma parameter |
Author(s)
Edilberto Cepeda-Cuervo ecepedac@unal.edu.co, Maria Victoria Cifuentes-Amado mvcifuentesa@unal.edu.co, Margarita Marin mmarinj@unal.edu.co
References
1. Cepeda C. E. (2001). Modelagem da variabilidade em modelos lineares generalizados. Unpublished Ph.D. tesis. Instituto de Matematicas. Universidade Federal do Rio do Janeiro. //http://www.docentes.unal.edu.co/ecepedac/docs/MODELAGEM20DA20VARIABILIDADE.pdf. http://www.bdigital.unal.edu.co/9394/. 2.Cepeda, E. C. and Gamerman D. (2005). Bayesian Methodology for modeling parameters in the two-parameter exponential family. Estadistica 57, 93 105. // 3.Cepeda, E. and Garrido, L. (2011). Bayesian beta regression models: joint mean and precision modeling. Universidad Nacional // 4.Cepeda, E. and Migon, H. and Garrido, L. and Achcar, J. (2012) Generalized Linear models with random effects in the two parameter exponential family. Journal of Statistical Computation and Simulation. 1, 1 13. // 5.Cepeda-Cuervo, E. and Cifuentes-Amado, V. (2016) Double generalized beta-binomial and negative binomial regression. To appear.
the probability of a beta parameter from the probability density function defined by old parameters
Description
evaluate the probability of a beta parameter from the probability density function defined by old parameters
Usage
mukernel(y, x, z, betas.now,betas.old,gammas.ini,bpri,Bpri,model,m,ni)
Arguments
y |
object of class matrix or vector, with the dependent variable. |
x |
object of class matrix, with the variables for modelling the mean. |
z |
object of class matrix, with the variables for modelling the shape, variance or dispersion. |
betas.now |
a vector with the beta parameter, new parameter, to evaluate in the old p.d.f |
betas.old |
a vector with the beta that define the old p.d.f |
gammas.ini |
a vector with the gamma that define the old p.d.f |
bpri |
a vector with the prior values of beta. |
Bpri |
a matrix with the prior values of the variance of beta. |
model |
it indicates the model that will be used. By default, is the Beta Binomial model (BB), but it could also be the Negative Binomial with mean and shape (NB1) or the Negative Binomial with mean and variance (NB2). |
m |
It is positive integer that In the Beta Binomial model indicates the number of trials. By default, is the number of data |
ni |
It is a vector of positive integer that In the Beta Binomial model indicates the number of trials to each individual. By default, is a vector of m |
Details
Evaluate the probability of a beta parameter from the probability density function defined by old parameters, according with the model proposed by Cepeda(2001) and Cepeda and Gamerman(2005).
Value
value |
a matrix with the probability for the beta parameter from the probability density function defined by old parameters |
Author(s)
Edilberto Cepeda-Cuervo ecepedac@unal.edu.co, Maria Victoria Cifuentes-Amado mvcifuentesa@unal.edu.co, Margarita Marin mmarinj@unal.edu.co
References
1. Cepeda C. E. (2001). Modelagem da variabilidade em modelos lineares generalizados. Unpublished Ph.D. tesis. Instituto de Matematicas. Universidade Federal do Rio do Janeiro. //http://www.docentes.unal.edu.co/ecepedac/docs/MODELAGEM20DA20VARIABILIDADE.pdf. http://www.bdigital.unal.edu.co/9394/. 2.Cepeda, E. C. and Gamerman D. (2005). Bayesian Methodology for modeling parameters in the two-parameter exponential family. Estadistica 57, 93 105. // 3.Cepeda, E. and Garrido, L. (2011). Bayesian beta regression models: joint mean and precision modeling. Universidad Nacional // 4.Cepeda, E. and Migon, H. and Garrido, L. and Achcar, J. (2012) Generalized Linear models with random effects in the two parameter exponential family. Journal of Statistical Computation and Simulation. 1, 1 13. // 5.Cepeda-Cuervo, E. and Cifuentes-Amado, V. (2016) Double generalized beta-binomial and negative binomial regression. To appear.
A proposal for beta parameter
Description
Propose a value for the beta parameter
Usage
muproposal(y, x, z, betas.ini,gammas.ini,bpri,Bpri,model,m,ni)
Arguments
y |
object of class matrix or vector, with the dependent variable. |
x |
object of class matrix, with the variables for modelling the mean. |
z |
object of class matrix, with the variables for modelling the shape, variance or dispersion. |
betas.ini |
a vector with the beta that define the old p.d.f |
gammas.ini |
a vector with the gamma that define the old p.d.f |
bpri |
a vector with the prior values of beta. |
Bpri |
a matrix with the prior values of the variance of beta. |
model |
it indicates the model that will be used. By default, is the Beta Binomial model (BB), but it could also be the Negative Binomial with mean and shape (NB1) or the Negative Binomial with mean and variance (NB2). |
m |
It is positive integer that In the Beta Binomial model indicates the number of trials. By default, is the number of data |
ni |
It is a vector of positive integer that In the Beta Binomial model indicates the number of trials to each individual. By default, is a vector of m |
Details
Generate a proposal for the beta parameter according to the model proposed by Cepeda(2001) and Cepeda and Gamerman(2005).
Value
value |
a matrix with the proposal for beta |
Author(s)
Edilberto Cepeda-Cuervo ecepedac@unal.edu.co, Maria Victoria Cifuentes-Amado mvcifuentesa@unal.edu.co, Margarita Marin mmarinj@unal.edu.co
References
1. Cepeda C. E. (2001). Modelagem da variabilidade em modelos lineares generalizados. Unpublished Ph.D. tesis. Instituto de Matematicas. Universidade Federal do Rio do Janeiro. //http://www.docentes.unal.edu.co/ecepedac/docs/MODELAGEM20DA20VARIABILIDADE.pdf. http://www.bdigital.unal.edu.co/9394/. 2.Cepeda, E. C. and Gamerman D. (2005). Bayesian Methodology for modeling parameters in the two-parameter exponential family. Estadistica 57, 93 105. // 3.Cepeda, E. and Garrido, L. (2011). Bayesian beta regression models: joint mean and precision modeling. Universidad Nacional // 4.Cepeda, E. and Migon, H. and Garrido, L. and Achcar, J. (2012) Generalized Linear models with random effects in the two parameter exponential family. Journal of Statistical Computation and Simulation. 1, 1 13. // 5.Cepeda-Cuervo, E. and Cifuentes-Amado, V. (2016) Double generalized beta-binomial and negative binomial regression. To appear.
print.NegBinBetaBinreg
Description
Print the Negative Binomial regression models with mean and shape (or variance) regression structures, and Beta Binomial regression with mean and dispersion regression structures.
Usage
## S3 method for class 'NegBinBetaBinreg'
print(x,...)
Arguments
x |
object of class NegBinBetaBinreg |
... |
not used. |
Value
print the Negative Binomial regression with mean and shape modeling and mean and variance modeling and Beta Binomial regression with mean and dispersion modeling
Author(s)
Edilberto Cepeda-Cuervo ecepedac@unal.edu.co, Maria Victoria Cifuentes-Amado mvcifuentesa@unal.edu.co, Margarita Marin mmarinj@unal.edu.co
References
1. Cepeda C. E. (2001). Modelagem da variabilidade em modelos lineares generalizados. Unpublished Ph.D. tesis. Instituto de Matematicas. Universidade Federal do Rio do Janeiro. //http://www.docentes.unal.edu.co/ecepedac/docs/MODELAGEM20DA20VARIABILIDADE.pdf. http://www.bdigital.unal.edu.co/9394/. 2.Cepeda, E. C. and Gamerman D. (2005). Bayesian Methodology for modeling parameters in the two-parameter exponential family. Estadistica 57, 93 105. // 3.Cepeda, E. and Garrido, L. (2011). Bayesian beta regression models: joint mean and precision modeling. Universidad Nacional // 4.Cepeda, E. and Migon, H. and Garrido, L. and Achcar, J. (2012) Generalized Linear models with random effects in the two parameter exponential family. Journal of Statistical Computation and Simulation. 1, 1 13. // 5.Cepeda-Cuervo, E. and Cifuentes-Amado, V. (2016) Double generalized beta-binomial and negative binomial regression. To appear.
print the summary of the NegBinBetaBinreg
Description
Print the summary for a Negative Binomial regression models with mean and shape (or variance) regression structures, and Beta Binomial regression with mean and dispersion regression structures.
Usage
## S3 method for class 'summary.NegBinBetaBinreg'
print(x, ...)
Arguments
x |
object of class NegBinBetaBinreg |
... |
not used. |
Value
Print the summary for a Negative Binomial regression with mean and shape modeling and mean and variance modeling and Beta Binomial regression with mean and dispersion modeling
Author(s)
Edilberto Cepeda-Cuervo ecepedac@unal.edu.co, Maria Victoria Cifuentes-Amado mvcifuentesa@unal.edu.co, Margarita Marin mmarinj@unal.edu.co
References
1. Cepeda C. E. (2001). Modelagem da variabilidade em modelos lineares generalizados. Unpublished Ph.D. tesis. Instituto de Matematicas. Universidade Federal do Rio do Janeiro. //http://www.docentes.unal.edu.co/ecepedac/docs/MODELAGEM20DA20VARIABILIDADE.pdf. http://www.bdigital.unal.edu.co/9394/. 2.Cepeda, E. C. and Gamerman D. (2005). Bayesian Methodology for modeling parameters in the two-parameter exponential family. Estadistica 57, 93 105. // 3.Cepeda, E. and Garrido, L. (2011). Bayesian beta regression models: joint mean and precision modeling. Universidad Nacional // 4.Cepeda, E. and Migon, H. and Garrido, L. and Achcar, J. (2012) Generalized Linear models with random effects in the two parameter exponential family. Journal of Statistical Computation and Simulation. 1, 1 13. // 5.Cepeda-Cuervo, E. and Cifuentes-Amado, V. (2016) Double generalized beta-binomial and negative binomial regression. To appear.
summary.NegBinBetaBinreg
Description
Print the Negative Binomial regression models with mean and shape (or variance) regression structures, and Beta Binomial regression with mean and dispersion regression structures.
Usage
## S3 method for class 'NegBinBetaBinreg'
summary(object, ...)
Arguments
object |
an object of class NegBinBetaBinreg |
... |
not used. |
Value
call |
Call |
coefficients |
Coefficients |
AIC |
AIC |
BIC |
BIC |
Author(s)
Edilberto Cepeda-Cuervo ecepedac@unal.edu.co, Maria Victoria Cifuentes-Amado mvcifuentesa@unal.edu.co, Margarita Marin mmarinj@unal.edu.co
References
1. Cepeda C. E. (2001). Modelagem da variabilidade em modelos lineares generalizados. Unpublished Ph.D. tesis. Instituto de Matematicas. Universidade Federal do Rio do Janeiro. //http://www.docentes.unal.edu.co/ecepedac/docs/MODELAGEM20DA20VARIABILIDADE.pdf. http://www.bdigital.unal.edu.co/9394/. 2.Cepeda, E. C. and Gamerman D. (2005). Bayesian Methodology for modeling parameters in the two-parameter exponential family. Estadistica 57, 93 105. // 3.Cepeda, E. and Garrido, L. (2011). Bayesian beta regression models: joint mean and precision modeling. Universidad Nacional // 4.Cepeda, E. and Migon, H. and Garrido, L. and Achcar, J. (2012) Generalized Linear models with random effects in the two parameter exponential family. Journal of Statistical Computation and Simulation. 1, 1 13. // 5.Cepeda-Cuervo, E. and Cifuentes-Amado, V. (2016) Double generalized beta-binomial and negative binomial regression. To appear.
Likelihood
Description
calculate the likelihood value for the Negative Binomial regression models with mean and shape (or variance) regression structures, and Beta Binomial regression with mean and dispersion regression structures.
Usage
veros(y,x,z,betas,gammas,model,m)
Arguments
y |
object of class matrix, with the dependent variable |
x |
object of class matrix, with the variables for modelling the mean |
z |
object of class matrix, with the variables for modelling the variance |
betas |
a vector with the previous proposal beta parameters |
gammas |
a vector with the previous proposal gamma parameters |
model |
it indicates the model that will be used. By default, is the Beta Binomial model (BB), but it could also be the Negative Binomial with mean and shape (NB1) or the Negative Binomial with mean and variance (NB2). |
m |
It is positive integer that In the Beta Binomial model indicates the number of trials. By default, is the number of data |
Details
calculate the likelihood value for the Negative Binomial regression with mean and shape modeling and mean and variance modeling and Beta Binomial regression with mean and dispersion modeling.
Value
value |
a integer with the likelihood |
Author(s)
Edilberto Cepeda-Cuervo ecepedac@unal.edu.co, Maria Victoria Cifuentes-Amado mvcifuentesa@unal.edu.co, Margarita Marin mmarinj@unal.edu.co
References
1. Cepeda C. E. (2001). Modelagem da variabilidade em modelos lineares generalizados. Unpublished Ph.D. tesis. Instituto de Matematicas. Universidade Federal do Rio do Janeiro. //http://www.docentes.unal.edu.co/ecepedac/docs/MODELAGEM20DA20VARIABILIDADE.pdf. http://www.bdigital.unal.edu.co/9394/. 2.Cepeda, E. C. and Gamerman D. (2005). Bayesian Methodology for modeling parameters in the two-parameter exponential family. Estadistica 57, 93 105. // 3.Cepeda, E. and Garrido, L. (2011). Bayesian beta regression models: joint mean and precision modeling. Universidad Nacional // 4.Cepeda, E. and Migon, H. and Garrido, L. and Achcar, J. (2012) Generalized Linear models with random effects in the two parameter exponential family. Journal of Statistical Computation and Simulation. 1, 1 13. // 5.Cepeda-Cuervo, E. and Cifuentes-Amado, V. (2016) Double generalized beta-binomial and negative binomial regression. To appear.