gfilmm: Generalized fiducial inference

View source: R/gfilmm.R

gfilmmR Documentation

Generalized fiducial inference

Description

Samples the fiducial distributions.

Usage

gfilmm(
  y,
  fixed,
  random,
  data,
  N,
  thresh = N/2,
  long = FALSE,
  seed = NULL,
  nthreads = parallel::detectCores()
)

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

Arguments

y

a right-sided formula of the form ~ cbind(lower,upper) for the interval data

fixed

a right-sided formula for the fixed effects

random

a right-sided formula for the random effects, or NULL for no random effect

data

the data, a dataframe

N

desired number of simulations

thresh

threshold, default N/2; for experts only

long

logical, whether to use long doubles instead of doubles in the algorithm

seed

the seed for the C++ random numbers generator, a positive integer, or NULL to use a random seed

nthreads

number of threads to run the algorithm with parallelized blocks of code

x

a gfilmm object

...

ignored

Value

A list with two components: a dataframe VERTEX, and a vector WEIGHT. It has class gfilmm.

References

J. Cisewski and J.Hannig. Generalized fiducial inference for normal linear mixed models. The Annals of Statistics 2012, Vol. 40, No. 4, 2102–2127.

Examples

h <- 0.01
gfi <- gfilmm(
  ~ cbind(yield-h, yield+h), ~ 1, ~ block, data = npk, N = 5000, nthreads = 2
)
# fiducial cumulative distribution function of the intercept:
Fintercept <- gfiCDF(~ `(Intercept)`, gfi)
plot(Fintercept, xlim = c(40, 65))
# fiducial confidence interval of the intercept:
gfiConfInt(~ `(Intercept)`, gfi)
# fiducial density function of the intercept:
library(kde1d)
kfit <- kde1d(gfi$VERTEX[["(Intercept)"]], weights = gfi$WEIGHT)
curve(dkde1d(x, kfit), from = 45, to = 65)

gfilmm documentation built on July 12, 2022, 1:05 a.m.