MLM_Exact_Design: rounding algorithm for multinomial logit models

View source: R/MLM_Exact_Design.R

MLM_Exact_DesignR Documentation

rounding algorithm for multinomial logit models

Description

rounding algorithm for multinomial logit models

Usage

MLM_Exact_Design(
  J,
  k.continuous,
  design_x,
  design_p,
  det.design,
  p,
  ForLion,
  bvec,
  bvec_matrix,
  rel.diff,
  L,
  N,
  hfunc,
  link
)

Arguments

J

number of response levels in the multinomial logit model

k.continuous

number of continuous factors

design_x

the matrix with rows indicating design point which we got from the approximate design

design_p

the corresponding approximate allocation

det.design

the determinant of the approximate design

p

number of parameters

ForLion

TRUE or FALSE, TRUE: this approximate design was generated by ForLion algorithm, FALSE: this approximate was generated by EW ForLion algorithm

bvec

If ForLion==TRUE assumed parameter values of model parameters beta, same length of h(y)

bvec_matrix

If ForLion==FALSE the matrix of the sampled parameter values of beta

rel.diff

points with distance less than that will be merged

L

vector: rounding factors

N

total number of observations

hfunc

function for obtaining model matrix h(y) for given design point y, y has to follow the same order as n.factor

link

link function, default "continuation", other choices "baseline", "cumulative", and "adjacent"

Value

x.design matrix with rows indicating design point

ni.design exact allocation

rel.efficiency relative efficiency of the Exact and Approximate Designs

Examples

J=3
k.continuous=1
design_x<-c(0.0000,103.5451,149.2355)
design_p<-c(0.2027, 0.3981, 0.3992)
det.design=54016609
p=5
theta = c(-1.935, -0.02642, 0.0003174, -9.159, 0.06386)
hfunc.temp = function(y){
   matrix(data=c(1,y,y*y,0,0,0,0,0,1,y,0,0,0,0,0), nrow=3,
            ncol=5, byrow=TRUE)
}
link.temp = "continuation"
MLM_Exact_Design(J=J, k.continuous=k.continuous,design_x=design_x,
design_p=design_p,det.design=det.design,p=p,ForLion=TRUE,bvec=theta,
rel.diff=1,L=0.5,N=1000,hfunc=hfunc.temp,link=link.temp)

ForLion documentation built on June 10, 2025, 5:13 p.m.