Package 'Bayesiantreg'

Title: Bayesian t Regression for Modeling Mean and Scale Parameters
Description: Performs Bayesian t Regression where mean and scale parameters are modeling by lineal regression structures, and the degrees of freedom parameters are estimated.
Authors: Margarita Marin and Edilberto Cepeda-Cuervo.
Maintainer: Margarita Marin <[email protected]>
License: GPL (>= 2)
Version: 1.0.1
Built: 2025-03-09 02:55:05 UTC
Source: https://github.com/cran/Bayesiantreg

Help Index


Function to do Bayesian t Regression: joint mean and variance modeling and estimation of the degrees of freedom

Description

Bayesian t regression package

Details

Package: Bayesiantreg
Type: Package
Version: 1.0
Date: 2020-05-31
License: GPL-2
LazyLoad: yes

Author(s)

Margarita Marin [email protected], Edilberto Cepeda-Cuervo [email protected]


Bayesiantreg

Description

Function to do Bayesian t Regression: joint mean and variance modeling and estimation of the degrees of freedom

Usage

Bayesiantreg(y, x, z, nsim, bini, bpri, Bpri, gini, gpri,Gpri, glini, glpri, 
           type, apriori, propuesta, Maxi=NULL,
           lambda = NULL, p = NULL, burn, jump, graph1 = TRUE, graph2 = TRUE,
           graph3 = TRUE)

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 precision.

nsim

a number that indicate the number of iterations.

bini

a vector with the initial values of beta.

bpri

a vector with the values of the mean of the prior of beta.

Bpri

a matrix with the values of the variance of the prior of beta.

gini

a vector with the initial values of gamma.

gpri

a vector with the values of the mean of the prior of gamma.

Gpri

a matrix with the values of the variance of the prior of gamma.

glini

a vector with the initial value of the degrees of freedom.

glpri

a vector with the value of the the prior of the degrees of freedom.

type

a vector that can take the value "D" if the prior for the degrees of freedom considered as discrete or "C" if it is continuous.

apriori

when type is "D", it is a vector that can take the values of "poi" for a Poisson prior or "unif" for a uniform prior. When type is "C", it is a vector that can take the values of "exp" for the exponential prior, "unif" for the uniform prior or "J2" for the Jeffrey's prior.

propuesta

when type is "D", it is a vector that can take the values of "poi" for a Poisson proposal, "unif" for a uniform proposal or by default the proposal made by Marin and Cepeda (_). When type is "C", it is a vector that can take the values of "exp" for the exponential proposal, "unif" for the uniform proposal, "J2" for the Jeffrey's proposal or by default the proposal made by Marin and Cepeda (_).

Maxi

a number indicating the maximum value for the uniform prior an the uniforme proposal.

lambda

a number indicating the mean parameter value for the Poisson prior an the Poisson proposal.

p

a number indicating the parameter value for the Jeffrey's prior an the Jeffrey's proposal.

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.

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.

graph3

if it is TRUE present the graph of the standardized residuals, the the standardized residuals against the lineal predictor, the pseudo deviance residuals and the pseudo deviance residuals against the lineal predictor.

Details

The bayesian t regression allows the joint modelling of mean and variance and the estimation of the degrees of freedom of a t distributed variable, as is proposed in Marin and Cepeda (_), with identical link for the mean and logarithmic for the variance, and differents discrete and continuous aproach for the degrees of freedom.

Value

object of class bayesbetareg with:

coefficients

object of class matrix with the estimated coefficients of beta, gamma and degrees of freedom.

interv

object of class matrix with the estimated confidence intervals of beta, gamma and the degrees of freedom.

fitted.values

object of class matrix with the fitted values of y.

residuals

object of class matrix with the residuals of the regression.

residualsstd

object of class matrix with the standardized residuals of the regression.

residualsdev

object of class matrix with the pseudo deviance residuals of the regression.

variance

object of class matrix with the variance terms 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.

gl.mcmc

object of class matrix with the complete chains for the degrees of freedom.

beta.mcmc.burn

object of class matrix with the chains for beta after the burned process.

gamma.mcmc.burn

object of class matrix with the chains for gamma after the burned process.

gl.mcmc.burn

object of class matrix with the chains for the degreees of freedom after the burned process.

loglik

the logaritmic of the liklihood of the model.

AIC

AIC of the model.

BIC

BIC of the model.

DIC

BIC of the model.

PseudoDeviance

Pseudo deviance criteria of the model as is proposed by Marin and Cepeda (_).

arb

acceptance percentage for beta.

arg

acceptance percentage for gamma.

argl

acceptance percentage for the degrees of freedom.

call

Call.

Author(s)

Margarita Marin [email protected], Edilberto Cepeda-Cuervo [email protected]

2. Cepeda-Cuervo E. (2001). Modelagem da variabilidade em modelos lineares generalizados. Unpublished Ph.D. tesis. Instituto de Matematicas. Universidade Federal do Rio do Janeiro.

3. Cepeda C., E. and Gamerman D. (2001). Bayesian Modeling of Variance Heterogeneity in Normal Regression Models. Brazilian Journal of Probability and Statistics. 14, 207-221

References

1. Marin and Cepeda-Cuervo (_). A Bayesian regression model for the non-standardized t distribution with location, scale and degrees of freedom parameters. Unpublished

Examples

n <- 10
X1 <- runif(n,0,10)
X2 <- runif(n,5,10)
X3 <- runif(n,10,15)


y1 <- c(0.09, 1.68, -2.43, 0.23, 2.94, 1.50, 3.40, 2.22, 0.28, -0.17)

betas <- c(0,0,0,0)
gammas <- c(0,0,0)
gl <- 3

x <- cbind(rep(1,n),X1,X2,X3)
z <- cbind(rep(1,n),X2,X3)
y <- y1

Bpri <- diag(rep(100,4))
bpri <- rep(0,4)

Gpri <- diag(rep(10,3))
gpri <- rep(0,3)

glpri <- 7

propuesta <- "unif2"
apriori <- "unif"
tipo <- "D"

Maxi <- 100
nsim <- 50

bini=bpri
gini=gpri
glini=glpri

reg1 <- Bayesiantreg(y, x, z, nsim=nsim, bini, bpri, 
                     Bpri, gini, 
                     gpri,Gpri, glini, glpri, 
                     type=tipo, apriori=apriori, 
                     propuesta=propuesta, 
                     Maxi=Maxi,burn=0.3, jump=3, 
                    graph1 = TRUE, graph2 = TRUE, graph3 = TRUE)

Bayesian t regression

Description

Function to do Bayesian t Regression: joint mean and variance modeling and estimation of the degrees of freedom

Usage

BayesiantregEst(y, x, z, nsim, bini, bpri, Bpri, gini, gpri, Gpri, glini, glpri, 
           type, apriori, propuesta, Maxi=NULL,
           lambda = NULL, p = NULL, burn, jump, graph1 = TRUE, graph2 = TRUE,
           graph3 = TRUE)

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 precision.

nsim

a number that indicate the number of iterations.

bini

a vector with the initial values of beta.

bpri

a vector with the values of the mean of the prior of beta.

Bpri

a matrix with the values of the variance of the prior of beta.

gini

a vector with the initial values of gamma.

gpri

a vector with the values of the mean of the prior of gamma.

Gpri

a matrix with the values of the variance of the prior of gamma.

glini

a vector with the initial value of the degrees of freedom.

glpri

a vector with the value of the the prior of the degrees of freedom.

type

a vector that can take the value "D" if the prior for the degrees of freedom considered as discrete or "C" if it is continuous.

apriori

when type is "D", it is a vector that can take the values of "poi" for a Poisson prior or "unif" for a uniform prior. When type is "C", it is a vector that can take the values of "exp" for the exponential prior, "unif" for the uniform prior or "J2" for the Jeffrey's prior.

propuesta

when type is "D", it is a vector that can take the values of "poi" for a Poisson proposal, "unif" for a uniform proposal or by default the proposal made by Marin and Cepeda (_). When type is "C", it is a vector that can take the values of "exp" for the exponential proposal, "unif" for the uniform proposal, "J2" for the Jeffrey's proposal or by default the proposal made by Marin and Cepeda (_).

Maxi

a number indicating the maximum value for the uniform prior an the uniforme proposal.

lambda

a number indicating the mean parameter value for the Poisson prior an the Poisson proposal.

p

a number indicating the parameter value for the Jeffrey's prior an the Jeffrey's proposal.

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.

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.

graph3

if it is TRUE present the graph of the standardized residuals, the the standardized residuals against the lineal predictor, the pseudo deviance residuals and the pseudo deviance residuals against the lineal predictor.

Details

The bayesian t regression allows the joint modelling of mean and variance and the estimation of the degrees of freedom of a t distributed variable, as is proposed in Marin and Cepeda (_), with identical link for the mean and logarithmic for the variance, and differents discrete and continuous aproach for the degrees of freedom.

Value

object of class bayesbetareg with:

coefficients

object of class matrix with the estimated coefficients of beta, gamma and degrees of freedom.

interv

object of class matrix with the estimated confidence intervals of beta, gamma and the degrees of freedom.

fitted.values

object of class matrix with the fitted values of y.

residuals

object of class matrix with the residuals of the regression.

residualsstd

object of class matrix with the standardized residuals of the regression.

residualsdev

object of class matrix with the pseudo deviance residuals of the regression.

variance

object of class matrix with the variance terms 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.

gl.mcmc

object of class matrix with the complete chains for the degrees of freedom.

beta.mcmc.burn

object of class matrix with the chains for beta after the burned process.

gamma.mcmc.burn

object of class matrix with the chains for gamma after the burned process.

gl.mcmc.burn

object of class matrix with the chains for the degreees of freedom after the burned process.

AIC

AIC of the model.

BIC

BIC of the model.

DIC

BIC of the model.

PseudoDeviance

a Pseudo Deviance criteria of the model as is proposed in Marin and Cepeda (_).

Author(s)

Margarita Marin [email protected], Edilberto Cepeda-Cuervo [email protected]

References

1. Marin and Cepeda-Cuervo (_). A Bayesian regression model for the non-standardized t distribution with location, scale and degrees of freedom parameters. Unpublished

2. Cepeda-Cuervo E. (2001). Modelagem da variabilidade em modelos lineares generalizados. Unpublished Ph.D. tesis. Instituto de Matematicas. Universidade Federal do Rio do Janeiro.

3. Cepeda C., E. and Gamerman D. (2001). Bayesian Modeling of Variance Heterogeneity in Normal Regression Models. Brazilian Journal of Probability and Statistics. 14, 207-221

Examples

#library(heavy)
 #data(ereturns)

 #y <- ereturns[,3]
 #x <- cbind(rep(1,nrow(ereturns)),ereturns[,4])
 #z <- x

 ## A priori para Beta
 #Bpri <- diag(rep(100,2))
 #bpri <- rep(0,2)

 ## A priori para Gamma
 #Gpri <- diag(rep(10,2))
 #gpri <- rep(0,2)

 ##otros parametros
 #glpri <- 7

 #propuesta <- "unif2"
 #apriori <- "unif"
 #type <- "D"

 #lambda <- 0.1
 #p <- 10
 #Maxi <- 100

 #nsim <- 100
 #burn <- 0.1
 #jump <- 2
 
 #bini=bpri
 #gini=gpri
 #glini=glpri

#reg1 <- Bayesiantreg(y, x, z, nsim, bini, bpri, Bpri, gini, gpri,Gpri, glini, glpri, 
#           type, apriori, propuesta, Maxi=NULL,
#           lambda = NULL, p = NULL, burn, jump, graph1 = T, graph2 = T,
#           graph3 = T)
#summary(reg1)

criteria for comparison the bayesian t regression models

Description

Performs the comparison criterias for the Bayesian t Regression

Usage

criteria(object,...)

Arguments

object

object of class "Bayesiantreg"

...

not used.

Details

This function allows to extract the information criteria from the model AIC, BIC, DIC and pseudo-deviance.

Value

loglik

the logaritmic of the liklihood of the model

AIC

the AiC criteria

BIC

the BIC criteria

DIC

the DIC criteria

PseudoDeviance

the pseudo deviance criteria of the model as is proposed in Marin and Cepeda (_).

Author(s)

Margarita Marin [email protected], Edilberto Cepeda-Cuervo [email protected],

References

1. Marin and Cepeda-Cuervo (_). A Bayesian regression model for the non-standardized t distribution with location, scale and degrees of freedom parameters. Unpublished

2. Cepeda-Cuervo E. (2001). Modelagem da variabilidade em modelos lineares generalizados. Unpublished Ph.D. tesis. Instituto de Matematicas. Universidade Federal do Rio do Janeiro.

3. Cepeda C., E. and Gamerman D. (2001). Bayesian Modeling of Variance Heterogeneity in Normal Regression Models. Brazilian Journal of Probability and Statistics. 14, 207-221


Loglikelihood for every point of the t model

Description

Calculate the loglikelihood for every point of the t model

Usage

devero(y, mu, sigma2, grados)

Arguments

y

object of class matrix, with the dependent variables.

mu

object of class matrix, with the mean of the model.

sigma2

object of class matrix, with the variace of the model.

grados

a vector with the degrees of freedom of the model.

Details

Calculate the loglikelihood for the t model as proposed by Marin and Cepeda (_).

Value

l

a value with the loglikelihood for the t model

Author(s)

Margarita Marin [email protected], Edilberto Cepeda-Cuervo [email protected]

References

1. Marin and Cepeda-Cuervo (_). A Bayesian regression model for the non-standardized t distribution with location, scale and degrees of freedom parameters. Unpublished

2. Cepeda-Cuervo E. (2001). Modelagem da variabilidade em modelos lineares generalizados. Unpublished Ph.D. tesis. Instituto de Matematicas. Universidade Federal do Rio do Janeiro.

3. Cepeda C., E. and Gamerman D. (2001). Bayesian Modeling of Variance Heterogeneity in Normal Regression Models. Brazilian Journal of Probability and Statistics. 14, 207-221


density of the Jeffrey's distribution

Description

calculates the density of the Jeffrey's distribution

Usage

dJ2(gl.ini, p)

Arguments

gl.ini

a vector with the number to evaluate in the density.

p

a number indicating the parameter value for the Jeffrey's prior an the Jeffrey's proposal

Details

Calculates the density of the Jeffrey's distribution

Value

J1

the value of the density

Author(s)

Margarita Marin [email protected], Edilberto Cepeda-Cuervo [email protected]


Posterior value of beta

Description

Calculate a value for posterior density for beta parameter

Usage

dpostb(y, x, z, betas, gammas, gl, bpri,Bpri)

Arguments

y

object of class matrix, with the dependen variables.

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 proposal beta parameters.

gammas

a vector with the proposal gamma parameters.

gl

a vector with the proposal degreees of freedom parameters.

bpri

a vector with the values of the mean of the prior of beta.

Bpri

a matrix with the values of the variance of the prior of beta.

Details

Generate the posterior density for the beta proposed by Marin and Cepeda (_).

Value

value

a value with the posterior denity for beta

Author(s)

Margarita Marin [email protected], Edilberto Cepeda-Cuervo [email protected]

References

1. Marin and Cepeda-Cuervo (_). A Bayesian regression model for the non-standardized t distribution with location, scale and degrees of freedom parameters. Unpublished

2. Cepeda-Cuervo E. (2001). Modelagem da variabilidade em modelos lineares generalizados. Unpublished Ph.D. tesis. Instituto de Matematicas. Universidade Federal do Rio do Janeiro.

3. Cepeda C., E. and Gamerman D. (2001). Bayesian Modeling of Variance Heterogeneity in Normal Regression Models. Brazilian Journal of Probability and Statistics. 14, 207-221


Posterior density of gamma

Description

Propose a value for posterior density of the gamma parameter

Usage

dpostg(y, x, z, betas, gammas, gl, gpri, Gpri)

Arguments

y

object of class matrix, with the dependent variables.

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 proposal beta parameters.

gammas

a vector with the proposal gamma parameters.

gl

a vector with the proposal degrees of freedom parameter.

gpri

a vector with the values of the mean of the prior of gamma.

Gpri

a matrix with the values of the variance of the prior of gamma.

Details

Generate the posterior density for the gamma proposed by Marin and Cepeda (_).

Value

value

a value with the posterior denity for gamma

Author(s)

Margarita Marin [email protected], Edilberto Cepeda-Cuervo [email protected]

References

1. Marin and Cepeda-Cuervo (_). A Bayesian regression model for the non-standardized t distribution with location, scale and degrees of freedom parameters. Unpublished

2. Cepeda-Cuervo E. (2001). Modelagem da variabilidade em modelos lineares generalizados. Unpublished Ph.D. tesis. Instituto de Matematicas. Universidade Federal do Rio do Janeiro.

3. Cepeda C., E. and Gamerman D. (2001). Bayesian Modeling of Variance Heterogeneity in Normal Regression Models. Brazilian Journal of Probability and Statistics. 14, 207-221


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, gl.ini, gpri, Gpri)

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 parameters that define the old p.d.f

gammas.now

a vector with the gamma parameters - new parameters - to evaluate in the old p.d.f

gammas.old

a vector with the gamma parameters that define the old p.d.f

gl.ini

a vector with the degrees of freedom parameters 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

Details

Evaluate the probability of a gamma parameter from the probability density function defined by old parameters, according with the model proposed by Marin and Cepeda-Cuervo (_).

Value

value

a vector with the probability for the gamma parameter from the probability density function defined by old parameters.

Author(s)

Margarita Marin [email protected], Edilberto Cepeda-Cuervo [email protected]

References

1. Marin and Cepeda-Cuervo (_). A Bayesian regression model for the non-standardized t distribution with location, scale and degrees of freedom parameters. Unpublished

2. Cepeda-Cuervo E. (2001). Modelagem da variabilidade em modelos lineares generalizados. Unpublished Ph.D. tesis. Instituto de Matematicas. Universidade Federal do Rio do Janeiro.

3. Cepeda C., E. and Gamerman D. (2001). Bayesian Modeling of Variance Heterogeneity in Normal Regression Models. Brazilian Journal of Probability and Statistics. 14, 207-221


A proposal for gamma parameters

Description

Propose a value for the gamma parameters

Usage

gammaproposal(y, x, z, betas.ini, gammas.ini, gl.ini, gpri, Gpri)

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

gl.ini

a vector with the previous proposal degrees of freedom parameter

gpri

a vector with the values of the mean of the prior of gamma.

Gpri

a matrix with the values of the variance of the prior of gamma.

Details

Generate a proposal for the gamma parameters according to the model proposed by Marin and Cepeda-Cuervo (_).

Value

gammas.pro

a number with the proposal for the gamma parameters.

Author(s)

Margarita Marin [email protected], Edilberto Cepeda-Cuervo [email protected]

References

1. Marin and Cepeda-Cuervo (_). A Bayesian regression model for the non-standardized t distribution with location, scale and degrees of freedom parameters. Unpublished

2. Cepeda-Cuervo E. (2001). Modelagem da variabilidade em modelos lineares generalizados. Unpublished Ph.D. tesis. Instituto de Matematicas. Universidade Federal do Rio do Janeiro.

3. Cepeda C., E. and Gamerman D. (2001). Bayesian Modeling of Variance Heterogeneity in Normal Regression Models. Brazilian Journal of Probability and Statistics. 14, 207-221


Posterior value of the degrees of freedom

Description

Calculate a value for posterior density of the degrees of freedom parameter

Usage

glpost(y, x, z, betas.ini, gammas.ini, gl.ini, Maxi, lambda, p, prior, type)

Arguments

y

object of class matrix, with the dependent variables.

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 proposal beta parameters.

gammas.ini

a vector with the proposal gamma parameters.

gl.ini

a vector with the proposal degrees of freedom parameter.

Maxi

a number indicating the maximum value for the uniform prior an the uniforme proposal

lambda

a number indicating the mean parameter value for the Poisson prior an the Poisson proposal

p

a number indicating the parameter value for the Jeffrey's prior an the Jeffrey's proposal

type

a vector that can take the value "D" if the prior for the degrees of freedom considered as discrete or "C" if it is continuous.

prior

when type is "D", it is a vector that can take the values of "poi" for a Poisson prior or "unif" for a uniform prior. When type is "C", it is a vector that can take the values of "exp" for the exponential prior, "unif" for the uniform prior or "J2" for the Jeffrey's prior.

Details

Generate the posterior density for the degrees of freedom proposed by Marin and Cepeda (_).

Value

value

a value with the posterior denity for the degrees of freedom

Author(s)

Margarita Marin [email protected], Edilberto Cepeda-Cuervo [email protected]

References

1. Marin and Cepeda-Cuervo (_). A Bayesian regression model for the non-standardized t distribution with location, scale and degrees of freedom parameters. Unpublished

2. Cepeda-Cuervo E. (2001). Modelagem da variabilidade em modelos lineares generalizados. Unpublished Ph.D. tesis. Instituto de Matematicas. Universidade Federal do Rio do Janeiro.

3. Cepeda C., E. and Gamerman D. (2001). Bayesian Modeling of Variance Heterogeneity in Normal Regression Models. Brazilian Journal of Probability and Statistics. 14, 207-221


A proposal for degrees of freedom parameter

Description

Propose a value for the degrees of freedom parameter

Usage

glproposal(gl.ini, lambda, p, Maxi, matriz, propuesta, type)

Arguments

gl.ini

a vector with the previous proposal degrees of freedom parameter

lambda

a number indicating the mean parameter value for the Poisson prior an the Poisson proposal.

p

a number indicating the parameter value for the Jeffrey's prior an the Jeffrey's proposal.

Maxi

a number indicating the maximum value for the uniform prior an the uniforme proposal.

matriz

a matrix generate by the function tabla of the bayesiantreg package.

propuesta

when type is "D", it is a vector that can take the values of "poi" for a Poisson proposal, "unif" for a uniform proposal or by default the proposal made by Marin and Cepeda (_). When type is "C", it is a vector that can take the values of "exp" for the exponential proposal, "unif" for the uniform proposal, "J2" for the Jeffrey's proposal or by default the proposal made by Marin and Cepeda (_).

type

a vector that can take the value "D" if the prior for the degrees of freedom considered as discrete or "C" if it is continuous.

Details

Generate a proposal for the gamma parameter according to the model proposed by Marin and Cepeda-Cuervo (_).

Value

gl.pro

a number with the proposal for the degrees of freedom parameter.

Author(s)

Margarita Marin [email protected], Edilberto Cepeda-Cuervo [email protected]

References

1. Marin and Cepeda-Cuervo (_). A Bayesian regression model for the non-standardized t distribution with location, scale and degrees of freedom parameters. Unpublished

2. Cepeda-Cuervo E. (2001). Modelagem da variabilidade em modelos lineares generalizados. Unpublished Ph.D. tesis. Instituto de Matematicas. Universidade Federal do Rio do Janeiro.

3. Cepeda C., E. and Gamerman D. (2001). Bayesian Modeling of Variance Heterogeneity in Normal Regression Models. Brazilian Journal of Probability and Statistics. 14, 207-221


the probability of a beta parameter from the probability density funcion 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, gl.ini, 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.now

a vector with the beta parameters - new parameters - to evaluate in the old p.d.f

betas.old

a vector with the beta parameters that define the old p.d.f

gammas.ini

a vector with the gammas parameters that define the old p.d.f

gl.ini

a vector with the degrees of freedom parameter that define the old p.d.f

bpri

a vector with the initial values of beta

Bpri

a matrix with the initial values of the variance of beta

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)

Margarita Marin [email protected], Edilberto Cepeda-Cuervo [email protected]

References

1. Marin and Cepeda-Cuervo (_). A Bayesian regression model for the non-standardized t distribution with location, scale and degrees of freedom parameters. Unpublished

2. Cepeda-Cuervo E. (2001). Modelagem da variabilidade em modelos lineares generalizados. Unpublished Ph.D. tesis. Instituto de Matematicas. Universidade Federal do Rio do Janeiro.

3. Cepeda C., E. and Gamerman D. (2001). Bayesian Modeling of Variance Heterogeneity in Normal Regression Models. Brazilian Journal of Probability and Statistics. 14, 207-221


A proposal for beta parameter

Description

Propose a value for the beta parameter

Usage

muproposal(y, x, z, betas.ini, gammas.ini, gl.ini, 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.ini

a vector with the previous proposal beta parameters

gammas.ini

a vector with the previous proposal gamma parameters

gl.ini

a vector with the previous proposal degrees of freedom parameter

bpri

a vector with the values of the mean of the prior of beta.

Bpri

a matrix with the values of the variance of the prior of beta.

Details

Generate a proposal for the beta parameters according to the model proposed by Marin and Cepeda-Cuervo (_).

Value

betas.pro

a number with the proposal for the beta parameters.

Author(s)

Margarita Marin [email protected], Edilberto Cepeda-Cuervo [email protected]

References

1. Marin and Cepeda-Cuervo (_). A Bayesian regression model for the non-standardized t distribution with location, scale and degrees of freedom parameters. Unpublished

2. Cepeda-Cuervo E. (2001). Modelagem da variabilidade em modelos lineares generalizados. Unpublished Ph.D. tesis. Instituto de Matematicas. Universidade Federal do Rio do Janeiro.

3. Cepeda C., E. and Gamerman D. (2001). Bayesian Modeling of Variance Heterogeneity in Normal Regression Models. Brazilian Journal of Probability and Statistics. 14, 207-221


density of the Jeffrey's distribution

Description

calculates the probability of the Jeffrey's distribution

Usage

pJ2(gl.ini, p)

Arguments

gl.ini

a vector with the number to evaluate in the density.

p

a number indicating the parameter value for the Jeffrey's prior an the Jeffrey's proposal

Details

Calculates the probability of the Jeffrey's distribution

Value

J1I

the value of the probability

Author(s)

Margarita Marin [email protected], Edilberto Cepeda-Cuervo [email protected]


print the summary of the Bayesian t regression

Description

Print the summary BBayesian t Regression: joint mean and variance modeling and estimation of the degrees of freedom

Usage

## S3 method for class 'summary.Bayesiantreg'
print(x, ...)

Arguments

x

object of class Bayesiantreg

...

not used.

Value

Print the summary Bayesian t Regression: joint mean and variance modeling and estimation of the degrees of freedom

Author(s)

Margarita Marin [email protected], Edilberto Cepeda-Cuervo [email protected]

References

1. Marin and Cepeda-Cuervo (_). A Bayesian regression model for the non-standardized t distribution with location, scale and degrees of freedom parameters. Unpublished

2. Cepeda-Cuervo E. (2001). Modelagem da variabilidade em modelos lineares generalizados. Unpublished Ph.D. tesis. Instituto de Matematicas. Universidade Federal do Rio do Janeiro.

3. Cepeda C., E. and Gamerman D. (2001). Bayesian Modeling of Variance Heterogeneity in Normal Regression Models. Brazilian Journal of Probability and Statistics. 14, 207-221


random number from the Jeffrey's distribution

Description

generates random numbers from the Jeffrey's distribution

Usage

rJ2(n, matriz, min, max)

Arguments

n

a number that indicates the number of random values that will by generate from the Jeffrey's distribution.

matriz

a matrix generate by the function tabla of the bayesiantreg package.

min

a number indicatein the minimum number that can be generated from the Jeffrey's distribution.

max

a number indicatein the maximum number that can be generated from the Jeffrey's distribution.

Details

generates random numbers from the Jeffrey's distribution

Value

grados

the random number

Author(s)

Margarita Marin [email protected], Edilberto Cepeda-Cuervo [email protected]


summary of the Bayesian t regression

Description

Summarized the Bayesian Bayesian t Regression: joint mean and variance modeling and estimation of the degrees of freedom

Usage

## S3 method for class 'Bayesiantreg'
summary(object, ...)

Arguments

object

an object of class Bayesiantreg

...

not used.

Value

call

Call

coefficients

Coefficients.

AIC

AIC of the model.

BIC

BIC of the model.

DIC

BIC of the model.

PseudoDeviance

Pseudo deviance criteria of the model as is proposed by Marin and Cepeda (_).

Author(s)

Margarita Marin [email protected], Edilberto Cepeda-Cuervo [email protected]

References

1. Marin and Cepeda-Cuervo (_). A Bayesian regression model for the non-standardized t distribution with location, scale and degrees of freedom parameters. Unpublished

2. Cepeda-Cuervo E. (2001). Modelagem da variabilidade em modelos lineares generalizados. Unpublished Ph.D. tesis. Instituto de Matematicas. Universidade Federal do Rio do Janeiro.

3. Cepeda C., E. and Gamerman D. (2001). Bayesian Modeling of Variance Heterogeneity in Normal Regression Models. Brazilian Journal of Probability and Statistics. 14, 207-221


probabilities and numbers from the Jeffrey's distribution

Description

generates a table with diferente probabilities and associated numbers from the Jeffrey's distribution

Usage

tabla(min, max, p)

Arguments

min

a number indicatein the minimum number that can be generated from the Jeffrey's distribution.

max

a number indicatein the maximum number that can be generated from the Jeffrey's distribution.

p

a number indicating the parameter value for the Jeffrey's prior an the Jeffrey's proposal.

Details

generates a table with diferente probabilities and associated numbers from the Jeffrey's distribution

Value

matriz

a matrix with the generated probabilities and associated numbers from the Jeffrey's distribution

Author(s)

Margarita Marin [email protected], Edilberto Cepeda-Cuervo [email protected]


Loglikelihood for the t model

Description

Calculate the loglikelihood for the t model

Usage

vero(y, mu, sigma2, grados)

Arguments

y

object of class matrix, with the dependent variables.

mu

object of class matrix, with the mean of the model.

sigma2

object of class matrix, with the variace of the model.

grados

a vector with the degrees of freedom of the model.

Details

Calculate the loglikelihood for the t model as proposed by Marin and Cepeda (_).

Value

l

a value with the loglikelihood for the t model

Author(s)

Margarita Marin [email protected], Edilberto Cepeda-Cuervo [email protected]

References

1. Marin and Cepeda-Cuervo (_). A Bayesian regression model for the non-standardized t distribution with location, scale and degrees of freedom parameters. Unpublished

2. Cepeda-Cuervo E. (2001). Modelagem da variabilidade em modelos lineares generalizados. Unpublished Ph.D. tesis. Instituto de Matematicas. Universidade Federal do Rio do Janeiro.

3. Cepeda C., E. and Gamerman D. (2001). Bayesian Modeling of Variance Heterogeneity in Normal Regression Models. Brazilian Journal of Probability and Statistics. 14, 207-221