This function performs the full FASH pipeline, including data setup, likelihood computation,
empirical Bayes estimation, and outputs a structured fash object.
Either a numeric matrix of response variables or a character string specifying the column name in data_list for response variables.
A numeric matrix, vector, or a character string specifying the column name in data_list for smoothing variables.
A numeric matrix, vector, scalar, or a character string specifying the column name in data_list for offset variables.
A numeric matrix, vector, scalar, or list representing the standard errors of Y. Or a character string specifying the column name in data_list for SD.
Either a list of precision matrices (one for each dataset) or a single precision matrix (shared across all datasets).
A list of data frames, where each data frame corresponds to a single dataset.
A numeric vector representing the grid of PSD (Predictive Standard Deviation) values.
A character string specifying the likelihood function to use. Options are `gaussian` and `poisson`.
An integer specifying the number of O-Spline basis functions.
A numeric value representing the precision of the fixed effects coefficients.
A positive integer specifying the order of the Integrated Wiener Process (IWP) prior.
A numeric value specifying the prediction step size.
A numeric value representing the lambda value for the Dirichlet prior.
An integer specifying the number of cores to use for parallel processing.
A logical value. If TRUE, shows progress messages and timing for each step.
A fash object containing:
prior_weightsEstimated prior weights for PSD values.
posterior_weightsPosterior weight matrix of PSD values.
psd_gridPSD grid values.
lfdrLocal false discovery rate for each dataset.
settingsA list of settings used in the FASH pipeline.
fash_dataA structured list of data components.
L_matrixLikelihood matrix used in the FASH pipeline.
eb_resultEmpirical Bayes estimation results.
set.seed(1)
data_list <- list(
data.frame(y = rpois(5, lambda = 5), x = 1:5, offset = 0),
data.frame(y = rpois(5, lambda = 5), x = 1:5, offset = 0)
)
grid <- seq(0, 2, length.out = 10)
result <- fash(data_list = data_list, Y = "y", smooth_var = "x", offset = "offset", grid = grid, likelihood = "poisson", verbose = TRUE)
#> Starting data setup...
#> Completed data setup in 0.00 seconds.
#> Starting likelihood computation...
#>
|
| | 0%
|
|=================================== | 50%
|
|======================================================================| 100%
#> Completed likelihood computation in 0.07 seconds.
#> Starting empirical Bayes estimation...
#> Completed empirical Bayes estimation in 0.00 seconds.
#> fash object created successfully.
print(result)
#> Fitted fash Object
#> -------------------
#> Number of datasets: 2
#> Likelihood: poisson
#> Number of PSD grid values: 10 (initial), 1 (non-trivial)
#> Order of Integrated Wiener Process (IWP): 1