fmem: Flexible Measurement Error Models

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

Description

fmem is used to obtain the statistical inference based on the Bayesian approach for the structural version of the flexible measurement error models under the presence of homoscedastic and heteroscedastic random errors. These models admits vectors of explanatory variables with and without measurement error as well as the presence of nonlinear effects, which is approximated by using B-splines. The error-prone variables and the random error follow scale mixtures of normal distributions.

Usage

1
fmem(formula, data, omeg, family, eta, burn.in, post.sam.s, thin, heter)

Arguments

formula

a symbolic description of the systematic component of the model to be fitted. See details for further information.

data

an optional data frame, list or environment containing the variables in the model.

omeg

(optional) the ratio ω=σ_{ε}^2/σ_{ξ}^2, this value must be specified when the model of interest is the homocedastic flexible measurement model. If this value is not specified is assumed to be 1, that is, σ_y^2=σ_{ξ}^2

family

a description of the error-prone variables and the random error distributions to be used in the model. Supported distributions include Normal, Student-t, Slash,Hyperbolic, Laplace and ContNormal, which correspond to normal, Student-t, slash, symmetric hyperbolic, Laplace and contaminated normal distributions, respectively.

eta

(optional) a numeric value or numeric vector that represents the extra parameter of the specified error distribution. This parameter can be assumed known or unknown.

burn.in

the number of burn-in iterations for the MCMC algorithm.

post.sam.s

the required size for the posterior sample of interest parameters.

thin

(optional) the thinning interval used in the simulation to obtain the required size for the posterior sample.

heter

(optional) An object type list that contains the values σ_{ε_i}^2 and Σ_{ξ_i} for all i (i=1,ldots,n). The objects have to be specified as sigma2y and sigma2xi, i.e. heter <- list(sigma2y, sigma2xi). If this argument is not specified the adjusted model is the version homocedastic.

Details

The argument formula comprises of three parts, namely: (i) observed response variable; (ii) covariates with measurement error; and (iii) covariates without measurement error including the non-parametric components, which can be specified by using the function bsp(). The first two parts are separated by the symbol "~" and the second and third parts are separated by the symbol "|".

This function allows to fit the measurement error model under the presence of homocedastic and heterocedastic random errors. These models admits vectors of explanatory variables with and without measurement error as well as the presence of nonlinear effects approximated by using B-splines. The model investigated is the structural version, as the error-prone variables follow scale mixtures of normal distributions.

Value

chains

A matrix that contains the posterior sample of interest parameters. Each column represents the marginal posterior sample of each parameter.

res

a vector of quantile residuals, proposed by Dunn and Smyth (1996) in the context of classical inference, but suited here to the Bayesian case.

K-L

a vector of case-deletion influence measures based on the Kullback-Leibler divergence.

X_2

a vector of case-deletion influence measures based on the X2-Distance divergence.

DIC

DIC criterion for model selection.

LMPL

Log-marginal pseudo-likelihood for model selection.

Author(s)

Luz Marina Rondon <lumarp@gmail.com> and Heleno Bolfarine

References

Rondon, L.M. and Bolfarine, H. (2015). Bayesian analysis of flexible measurement error models. (submitted)

See Also

bsp bsp.graph.fmem

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
#library(SemiPar)
#### Ragweed Pollen ####
#data(ragweed)
#attach(ragweed)
############ Example ragweed data
#ragweed2 <- ragweed[year==1993]
#day.in.seas  <- day.in.seas[year==1993]
#temperature <- temperature[year==1993]
#rain <- rain[year==1993]
#wind.speed <- wind.speed[year==1993]
#ragweedn <- data.frame(ragweed2,day.in.seas,temperature,rain,wind.speed)

#model <- fmem(sqrt(ragweed2) ~ wind.speed | rain + temperature + bsp(day.in.seas),
#			   data=ragweedn,family="Normal", burn.in=500, post.sam.s=2000,
#			   thin=10, omeg=1)
#summary(model)
#
###   Plot non-parametric component
#bsp.graph.fmem(model, which=1, xlab="Day", ylab="f(Day)")


############ Example Boston data 
#library(MASS)
#data(Boston)
#attach(Boston)

#model <- fmem(log(medv) ~ nox | crim + rm + bsp(lstat) + bsp(dis), data=Boston,
#              family="ContNormal", burn.in=10000, post.sam.s=5000, omeg=4, thin=10)
#summary(model)
#
###   Plot non-parametric components
#bsp.graph.fmem(model, which=1, xlab="lstat", ylab="f(lstat)") ### for variable lstat
#bsp.graph.fmem(model, which=2, xlab="dis", ylab="f(dis)") ### for variable dis
#

BayesGESM documentation built on May 2, 2019, 11:27 a.m.