find_param: Find optimal GIG parameters for W prior

View source: R/functions.R

find_paramR Documentation

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
)

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

Value

Optimal GIG parameters

Examples


a = 1
b = 5
n = 100
K = 3
find_param(a, b, n, K, no_cores=1)


R2D2ordinal documentation built on April 3, 2025, 7:50 p.m.