powered by
This function finds the optimal GIG parameters for the prior on W which induces a beta prior distribution on McFadden's R2.
find_param( a, b, n, K, alpha = rep(1, K), nsims = 1000, nreps = 5, no_cores = 10 )
Optimal GIG parameters
hyper-parameter of prior for R2 ~ Beta(a,b)
number of observations
number of response categories
prior hyper-parameters for prior Dirichlet distribution on response probabilities
number of times to simulate data
number of times to run the algorithm (default = 5)
number of cores to parallelize data-generation process
# \donttest{ a = 1 b = 5 n = 100 K = 3 find_param(a, b, n, K, no_cores=1) # }
Run the code above in your browser using DataLab