Learn R Programming

FMAdist (version 0.1.0)

rfma: FMA random-variate generation

Description

Generate random variates from the distribution specified by myfit which is the fitted input model via the frequentist model averaging “FMA” approach.

Usage

rfma(n, myfit)

Arguments

n

number of random variates to generate

myfit

a list object returned by fmafit containing the four components needed for random-variate generation: w, MLE_list, Fset, and data

Value

rfma generates random variates from the distribution specified by myfit

Details

rfma generates random variates that have the distribution of the model-average estimator. Each time a random variate is needed, a distribution is selected with probability equal to the corresponding weight and then a random variate from the fitted distribution is generated.

References

W. X. Jiang and B. L. Nelson (2018), "Better Input Modeling via Model Averaging," Proceedings of the 2018 Winter Simulation Conference, IEEE Press, 1575-1586.

See Also

See fmafit for creation of an input model (fitted distribution) via the frequentist model averaging “FMA” approach.

Examples

Run this code
# NOT RUN {
data<-rlnorm(500,meanlog=0,sdlog=0.25)
Fset<-c('gamma','weibull','normal','ED')
type<-'P' #by default type<-'Q'
J<-5  #by default J<-10
myfit<-fmafit(data,Fset,J,type)
n<-100
sim_data<-rfma(n,myfit)
# }

Run the code above in your browser using DataLab