Learn R Programming

R2D2ordinal (version 1.0.1)

find_param: Find optimal GIG parameters for W prior

Description

This function finds the optimal GIG parameters for the prior on W which induces a beta prior distribution on McFadden's R2.

Usage

find_param(
  a,
  b,
  n,
  K,
  alpha = rep(1, K),
  nsims = 1000,
  nreps = 5,
  no_cores = 10
)

Value

Optimal GIG parameters

Arguments

a

hyper-parameter of prior for R2 ~ Beta(a,b)

b

hyper-parameter of prior for R2 ~ Beta(a,b)

n

number of observations

K

number of response categories

alpha

prior hyper-parameters for prior Dirichlet distribution on response probabilities

nsims

number of times to simulate data

nreps

number of times to run the algorithm (default = 5)

no_cores

number of cores to parallelize data-generation process

Examples

Run this code
# \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