Class runing the bayesian model for the distribution parameters inference
Source:R/class_RstanAnalysis.r
RStanAnalysis.RdThis class generates results using rStan in order to inference diferent distribution parameters from a PairwiseLFC object
Methods
Method new()
Initialize RStanAnalysis object.
Usage
RStanAnalysis$new(
lfc_data,
option_data = data.frame(distribution = rep(1, 2), base_alpha_equals_0 = c(1, 1),
alpha_shift_equals_0 = c(1, 1), base_mu_equals_0 = c(1, 0), mu_shift_equals_0 = c(0,
0), sigma_ratio_equals_1 = c(0, 0)),
ncpus = 1,
seed = 1234567,
iter = 3000,
refresh = 0,
chains = 2,
estimation_approach = c("sampling", "optimizing"),
...
)Arguments
lfc_dataPairwiseLFC : log fold change daa
option_datais a dataframe with all the parametrization of the models that must be run. Each row correpond to a model.
"distribution": 0 (gaussian), 1 (cauchy) or 2 (logistic); default (1,1)
"base_alpha_equals_0": 0 or 1; default (1,1)
"alpha_shift_equals_0" 0 or 1; default (1,1)
"base_mu_equals_0": 0 or 1; default (1,0)
"mu_shift_equals_0": 0 or 1; default (0,0)
"sigma_ratio_equals_1": 0 or 1; default (0,0)
ncpusnumber of cpus to use for computation (default = 1)
seedseed for random computation in rStan (default=1234567)
iternumber of iteration in the rStan sampling (default=3000)
refreshcan be used to control how often the progress of the sampling is reported (i.e. show the progress every refresh iterations). By default, refresh = max(iter/10, 1). The progress indicator is turned off if refresh <= 0 (default=0).
chainsnumber of chains to run the rStan sampling (default=2)
estimation_approachapproach to find one estimates.
...other parameters pass to rStan sampling (see the documentation)
Method get_formatted_results()
Get the formated data for the prediction
Usage
RStanAnalysis$get_formatted_results(batchs = NULL, probs = c(0.25, 0.75))