gfilmm {gfilmm} | R 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 |
fixed |
a right-sided formula for the fixed effects |
random |
a right-sided formula for the random effects, or |
data |
the data, a dataframe |
N |
desired number of simulations |
thresh |
threshold, default |
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 |
nthreads |
number of threads to run the algorithm with parallelized blocks of code |
x |
a |
... |
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)