Learn R Programming

gfilinreg (version 2.0.1)

gfilinreg: Fiducial sampler for linear regression model

Description

Weighted samples of the fiducial distribution of the parameters of a linear regression model with normal, Student, Cauchy, or logistic error terms.

Usage

gfilinreg(
  formula,
  data = NULL,
  distr = "student",
  df = Inf,
  L = 30L,
  Kmax = 50L,
  nthreads = parallel::detectCores(),
  stopifbig = TRUE
)

Arguments

formula

two-sided formula defining the model

data

dataframe containing the data

distr

the distribution of the error terms, "normal", "student", "cauchy", or "logistic"

df

degrees of freedom of the Student distribution if distr = "student"

L

number of subdivisions of each axis of the hypercube (0,1)^(p+1)

Kmax

maximal number of combinations of indices to use

nthreads

number of threads for parallel computations

stopifbig

logical, whether to stop if the algorithm requires huge matrices

Value

A gfilinreg object, list with the fiducial samples and the weights.

References

Jan Hannig, Randy C.S. Lai, Thomas C.M. Lee. Computational issues of generalized fiducial inference. Computational Statistics and Data Analysis 71 (2014), 849<U+2013>858. <doi:10.1016/j.csda.2013.03.003>

Examples

Run this code
# NOT RUN {
set.seed(666L)
x <- c(1, 2, 3, 4)
y <- x + 3 * rcauchy(4L)
gfi <- gfilinreg(y ~ x, distr = "cauchy", L = 30L, nthreads = 2L)
gfiSummary(gfi)

# }

Run the code above in your browser using DataLab