B2ZM_BCLT: Bayesian Two-Zone Models: using Bayesian Central Limit...

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

B2ZM_BCLT obtains random samples from the posterior distribution of the parameters and exposure concentrations for the Bayesian two-zone model proposed by Zhang et al. (2009) using the Bayesian Central Limit Theorem (Laplace Approximation). The user can choose whether the near and far field measurement error processes are dependent or not. In the independent model, 5 parameters are considered: 1) Beta: Interzonal air flow rate (m3); 2) Q: supply and exhaust flow rate (m3/min); 3) G: contaminant emission rate (mg/min); 4) Tau_N: variance of the measurement error at the near field; 5)Tau_F; variance of the measurement error at the far field. In the dependent model (default), one more parameter is considered: 6) Tau_NF: covariance between the measurements at the near and far field. Any prior distribution for Beta, Q and G can be chosen. In the independent model, the prior distributions for Tau_N and Tau_F are inverse gamma distributions; in the dependent model, the prior joint distribution of Tau_N, Tau_NF and Tau_F is the Inverse Wishart Distribution (see the Details section for more information on the parameterization of these distributions). The output from B2ZM_BCLT is a list that belongs to the class bclt. This output is valid as an input for the functions summary and plot.

Usage

1
2
3
4
5
6
B2ZM_BCLT (data = NULL, priorBeta, priorQ, priorG, 
                      v, S, tauN.sh, tauN.sc, tauF.sh, tauF.sc,  
                      VN, VF, indep.model = FALSE, cred = 95,  
                      m = 7000, sample_size=2000, 
                      figures = list(save = FALSE, 
                      type = c("ps", "eps","pdf", "png", "jpg")))

Arguments

data

A 3-column matrix where the columns are time, concentrations at the near field, and concentrations at the far field, respectively. The time must be scaled in minutes (min), and the concentrations must be scaled in miligrams per cubic meter (mg/m3)

priorBeta

A string defining the prior distribution for the parameter Beta. To declare the prior distribution of Beta, use standard R nomenclature for probability distributions. For example, if the prior of Beta is a Uniform(0,20), declare it with "unif(0,20)"; if it is a Normal(0,1), declare it with "norm(0,1)". DO NOT put an "d" or "r" in front the name of the distributions. The options are: "unif(a,b)", "gamma(a,b)", "exp(a)", "norm(a,b)", "t(a)", "weibull(a,b)", "f(a,b)", "chisq(a,b)", "cauchy(a,b)" and "lnorm(a,b)".

priorQ

A string defining the prior distribution for Q (use the nomenclature as for priorBeta).

priorG

A string defining the prior distribution for G (use the nomenclature as for priorBeta).

v

Degrees of freedom for the Inverse Wishart distribution (prior joint distribution for Tau_N, Tau_NF and Tau_F in the dependent model).

S

A 2x2 positive definite matrix for the Inverse Wishart (prior joint distribution for Tau_N, Tau_NF and Tau_F in the dependent model).

tauN.sh

The shape parameter in the inverse gamma distribution (prior distribution for Tau_N in the independent model).

tauN.sc

The scalar parameter in the inverse gamma distribution (prior distribution for Tau_N in the independent model).

tauF.sh

The shape parameter in the inverse gamma distribution (prior distribution for Tau_F in the independent model).

tauF.sc

The scalar parameter in the inverse gamma distribution (prior distribution for Tau_F in the independent model).

VN

Volume of the near field in cubic meters (m3).

VF

Volume of the far field in cubic meters (m3).

indep.model

A logical value indicating whether the independent model should be considered. The default is FALSE.

cred

A scalar between 0 and 100 indicating the credibility level for the posterior intervals of the parameters.

m

Number of sampling values from the prior distribution used to estimate a good starting value that is used in the estimation of the posterior mode and covariance matrix. See the Details section for more information.

sample_size

Size of the sample from the posterior distribution of the parameters in model.

figures

The command plot(obj) produces several plots, where obj is the output from B2ZM_BCLT. Using figures, those plots are built internally and saved as eps, pdf, ps, png or jpg format. figures is a list containing the following parameters:

save:

a logical value indicating that the figures are to be saved. The default is FALSE.

type:

a string that indicates the image file type. The default is "ps".

Details

Parameterization priors: The inverse gamma distribution with shape a and scale b has mean b/(a-1) (a>1) and variance (b^2)/((a-1)^2(a-2)) (a>2). The inverse Wishart with v degrees of freedom and scalar matrix S has mean S/(v-p-1), where p is the number of rows of S.

Covariance Matrix estimation: The covariance matrix is estimated as the negative inverse of the hessian matrix of the log posterior distribution at the estimated posterior mode. To estimate the posterior mode, the function nlminb is used. The values of the estimated posterior mode depends on the starting parameter values. m is the number of sampling values from the prior distributions of Beta, Q and G. The vector (among the m sampled) with largest log posterior value is used as starting parameter values.

The covariance matrix is estimated using the function hessian from the package numDeriv, where the parameter vector is the estimated posterior mode.

Value

B2ZM_BCLT returns a list that belongs to the class bclt. The output from B2ZM_BCLT contains the objects:

Beta

a vector containing the sampled values from the joint posterior distribution for the parameter Beta.

Q

a vector containing the sampled values from the joint posterior distribution for the parameter Q.

G

a vector containing the sampled values from the joint posterior distribution for the parameter G.

tauN

a vector containing the sampled values from the joint posterior distribution for the parameter Tau_N.

tauF

a vector containing the sampled values from the joint posterior distribution for the parameter Tau_F.

tauNF

a vector containing the sampled values from the joint posterior distribution for the parameter Tau_NF (if the dependent model is used).

Y

a matrix containing the log of the observed concentrations.

DIC

deviance information criterion.

pD

effective number of parameters.

Dbar

Deviance expectation.

indep

a logical value indicating whether the independent model was used.

times

a vector containing the times when the observed concentrations were measured.

cred

credibility of the posterior intervals.

Methods defined for B2ZM_BCLT object are summary and plot.

Author(s)

Joao Vitor Dias Monteiro, Sudipto Banerjee and Gurumurthy Ramachandran.

References

Monteiro, J. V. D., Banerjee, S. and Ramachandran, G. (2011). B2Z: An R Package for Bayesian Two-Zone Models. Journal of Statistical Software 43 (2) 1–23. http://www.jstatsoft.org/v43/i02/

Zhang, Y., Banerjee, S., Yang,R., Lungu,C. and Ramachandran, G. (2009). Bayesian Modeling of Exposure and Airflow Using Two-Zone Models. The Annals of Occupational Hygiene, 53, 409-424. http://www.biostat.umn.edu/~sudiptob/ResearchPapers/ZBYLR.pdf

See Also

B2Z, B2ZM, B2ZM_IMIS,B2ZM_MCMC, B2ZM_SIR

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#####################
#Independent Model #
###################

#Data 1:  100 simulated concentrations during the times between 

#0 and 4, using the parameters Beta = 5, Q = 13.8, G = 351.5, 

#VN = pi*10^-3 VF = 3.8, Tau_N = 1, Tau_NF = 0.5 

#and Tau_F = 0.64. 
## Not run: 

data(ex1)

r <- B2ZM_BCLT(data = ex1, priorBeta = "unif(0,10)",
               priorQ="unif(11,17)", priorG = "unif(281,482)", 
               S = diag(10,2), v = 4, VN = pi*10^-3, VF = 3.8, 
               m = 7000, sample_size=2000)

summary(r)
plot(r)


#####################
#Independent Model #
###################

#Data 2:  100 simulated concentrations during the times between 

#0 and 4, using the parameters Beta = 5, Q = 13.8, G = 351.5, 

#VN = pi*10^-3, VF = 3.8, Tau_N = 1, Tau_NF = 0 

#and Tau_F = 0.64. 

data(ex2)


r <- B2ZM_BCLT(data = ex2, priorBeta = "unif(0,10)",
               priorQ="unif(11,17)", priorG = "unif(281,482)",
               tauN.sh = 5 , tauN.sc = 4 , tauF.sh = 5,
               tauF.sc = 7, VN = pi*10^-3, VF = 3.8, 
               indep.model = TRUE, m = 7000, sample_size=2000)

summary(r)
plot(r)

## End(Not run)

B2Z documentation built on May 2, 2019, 6:33 a.m.