Learn R Programming

Bayesianbetareg (version 1.2)

muproposal: A proposal for beta parameter

Description

Propose a value for the beta parameter

Usage

muproposal(Y,X,Z,betas,gammas,bpri,Bpri)

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

Value

value
a matrix with the proposal for beta

Details

Generate a proposal for the beta parameter according to the model proposed by Cepeda(2001) and Cepeda and Gamerman(2005).

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/MODELAGEMDAVARIABILIDADE.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.

Examples

Run this code
library(betareg)
data(ReadingSkills)


Y <- as.matrix(ReadingSkills[,1])
n <- length(Y)
X1 <- as.matrix(ReadingSkills[,2])
for(i in 1:length(X1)){
  X1 <- replace(X1,X1=="yes",1)
  X1 <- replace(X1,X1=="no",0)
}
X0 <- rep(1, times=n)
X1 <- as.numeric(X1)
X2 <- as.matrix(ReadingSkills[,3])
X3 <- X1*X2
X <- cbind(X0,X1,X2,X3)
Z0 <-  X0 
Z <- cbind(X0,X1)
betas.ind=c(0,0,0,0)
gammas.ind=c(0,0)
bpri=c(0,0,0,0)
Bpri=diag(10,nrow=ncol(X),ncol=ncol(X))

beta <- muproposal(Y,X,Z,betas.ind,gammas.ind,bpri,Bpri)
beta

Run the code above in your browser using DataLab