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 |
Bayesian t regression package
Package: | Bayesiantreg |
Type: | Package |
Version: | 1.0 |
Date: | 2020-05-31 |
License: | GPL-2 |
LazyLoad: | yes |
Margarita Marin [email protected], Edilberto Cepeda-Cuervo [email protected]
Function to do Bayesian t Regression: joint mean and variance modeling and estimation of the degrees of freedom
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)
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)
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. |
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.
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. |
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
1. Marin and Cepeda-Cuervo (_). A Bayesian regression model for the non-standardized t distribution with location, scale and degrees of freedom parameters. Unpublished
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)
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)
Function to do Bayesian t Regression: joint mean and variance modeling and estimation of the degrees of freedom
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)
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)
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. |
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.
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 (_). |
Margarita Marin [email protected], Edilberto Cepeda-Cuervo [email protected]
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
#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)
#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)
Performs the comparison criterias for the Bayesian t Regression
criteria(object,...)
criteria(object,...)
object |
object of class "Bayesiantreg" |
... |
not used. |
This function allows to extract the information criteria from the model AIC, BIC, DIC and pseudo-deviance.
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 (_). |
Margarita Marin [email protected], Edilberto Cepeda-Cuervo [email protected],
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
Calculate the loglikelihood for every point of the t model
devero(y, mu, sigma2, grados)
devero(y, mu, sigma2, grados)
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. |
Calculate the loglikelihood for the t model as proposed by Marin and Cepeda (_).
l |
a value with the loglikelihood for the t model |
Margarita Marin [email protected], Edilberto Cepeda-Cuervo [email protected]
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
calculates the density of the Jeffrey's distribution
dJ2(gl.ini, p)
dJ2(gl.ini, p)
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 |
Calculates the density of the Jeffrey's distribution
J1 |
the value of the density |
Margarita Marin [email protected], Edilberto Cepeda-Cuervo [email protected]
Calculate a value for posterior density for beta parameter
dpostb(y, x, z, betas, gammas, gl, bpri,Bpri)
dpostb(y, x, z, betas, gammas, gl, bpri,Bpri)
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. |
Generate the posterior density for the beta proposed by Marin and Cepeda (_).
value |
a value with the posterior denity for beta |
Margarita Marin [email protected], Edilberto Cepeda-Cuervo [email protected]
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
Propose a value for posterior density of the gamma parameter
dpostg(y, x, z, betas, gammas, gl, gpri, Gpri)
dpostg(y, x, z, betas, gammas, gl, gpri, Gpri)
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. |
Generate the posterior density for the gamma proposed by Marin and Cepeda (_).
value |
a value with the posterior denity for gamma |
Margarita Marin [email protected], Edilberto Cepeda-Cuervo [email protected]
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
evaluate the probability of a gamma parameter from the probability density function defined by old parameters.
gammakernel(y, x, z, betas.ini, gammas.now, gammas.old, gl.ini, gpri, Gpri)
gammakernel(y, x, z, betas.ini, gammas.now, gammas.old, gl.ini, gpri, Gpri)
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 |
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 |
a vector with the probability for the gamma parameter from the probability density function defined by old parameters. |
Margarita Marin [email protected], Edilberto Cepeda-Cuervo [email protected]
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
Propose a value for the gamma parameters
gammaproposal(y, x, z, betas.ini, gammas.ini, gl.ini, gpri, Gpri)
gammaproposal(y, x, z, betas.ini, gammas.ini, gl.ini, gpri, Gpri)
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. |
Generate a proposal for the gamma parameters according to the model proposed by Marin and Cepeda-Cuervo (_).
gammas.pro |
a number with the proposal for the gamma parameters. |
Margarita Marin [email protected], Edilberto Cepeda-Cuervo [email protected]
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
Calculate a value for posterior density of the degrees of freedom parameter
glpost(y, x, z, betas.ini, gammas.ini, gl.ini, Maxi, lambda, p, prior, type)
glpost(y, x, z, betas.ini, gammas.ini, gl.ini, Maxi, lambda, p, prior, type)
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. |
Generate the posterior density for the degrees of freedom proposed by Marin and Cepeda (_).
value |
a value with the posterior denity for the degrees of freedom |
Margarita Marin [email protected], Edilberto Cepeda-Cuervo [email protected]
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
Propose a value for the degrees of freedom parameter
glproposal(gl.ini, lambda, p, Maxi, matriz, propuesta, type)
glproposal(gl.ini, lambda, p, Maxi, matriz, propuesta, type)
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. |
Generate a proposal for the gamma parameter according to the model proposed by Marin and Cepeda-Cuervo (_).
gl.pro |
a number with the proposal for the degrees of freedom parameter. |
Margarita Marin [email protected], Edilberto Cepeda-Cuervo [email protected]
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
evaluate the probability of a beta parameter from the probability density function defined by old parameters
mukernel(y, x, z, betas.now, betas.old, gammas.ini, gl.ini, bpri, Bpri)
mukernel(y, x, z, betas.now, betas.old, gammas.ini, gl.ini, bpri, Bpri)
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 |
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 |
a matrix with the probability for the beta parameter from the probability density function defined by old parameters |
Margarita Marin [email protected], Edilberto Cepeda-Cuervo [email protected]
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
Propose a value for the beta parameter
muproposal(y, x, z, betas.ini, gammas.ini, gl.ini, bpri, Bpri)
muproposal(y, x, z, betas.ini, gammas.ini, gl.ini, bpri, Bpri)
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. |
Generate a proposal for the beta parameters according to the model proposed by Marin and Cepeda-Cuervo (_).
betas.pro |
a number with the proposal for the beta parameters. |
Margarita Marin [email protected], Edilberto Cepeda-Cuervo [email protected]
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
calculates the probability of the Jeffrey's distribution
pJ2(gl.ini, p)
pJ2(gl.ini, p)
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 |
Calculates the probability of the Jeffrey's distribution
J1I |
the value of the probability |
Margarita Marin [email protected], Edilberto Cepeda-Cuervo [email protected]
Print the summary BBayesian t Regression: joint mean and variance modeling and estimation of the degrees of freedom
## S3 method for class 'summary.Bayesiantreg' print(x, ...)
## S3 method for class 'summary.Bayesiantreg' print(x, ...)
x |
object of class Bayesiantreg |
... |
not used. |
Print the summary Bayesian t Regression: joint mean and variance modeling and estimation of the degrees of freedom
Margarita Marin [email protected], Edilberto Cepeda-Cuervo [email protected]
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
generates random numbers from the Jeffrey's distribution
rJ2(n, matriz, min, max)
rJ2(n, matriz, min, max)
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. |
generates random numbers from the Jeffrey's distribution
grados |
the random number |
Margarita Marin [email protected], Edilberto Cepeda-Cuervo [email protected]
Summarized the Bayesian Bayesian t Regression: joint mean and variance modeling and estimation of the degrees of freedom
## S3 method for class 'Bayesiantreg' summary(object, ...)
## S3 method for class 'Bayesiantreg' summary(object, ...)
object |
an object of class Bayesiantreg |
... |
not used. |
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 (_). |
Margarita Marin [email protected], Edilberto Cepeda-Cuervo [email protected]
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
generates a table with diferente probabilities and associated numbers from the Jeffrey's distribution
tabla(min, max, p)
tabla(min, max, p)
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. |
generates a table with diferente probabilities and associated numbers from the Jeffrey's distribution
matriz |
a matrix with the generated probabilities and associated numbers from the Jeffrey's distribution |
Margarita Marin [email protected], Edilberto Cepeda-Cuervo [email protected]
Calculate the loglikelihood for the t model
vero(y, mu, sigma2, grados)
vero(y, mu, sigma2, grados)
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. |
Calculate the loglikelihood for the t model as proposed by Marin and Cepeda (_).
l |
a value with the loglikelihood for the t model |
Margarita Marin [email protected], Edilberto Cepeda-Cuervo [email protected]
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