pejSim: pejSim

Description Usage Arguments Value Author(s) Examples

View source: R/pejSim.R

Description

This function computes the probabilty for a level ej to be sampled from a BOS distribution of parameters (mu,pi), with the number of levels equal to m. It can be used to generate data with a BOS distribution.

Usage

1
pejSim(ej,m,mu,p)

Arguments

ej

Levels to be sampled

m

Number of levels.

mu

mu parameter for BOS distribution.

p

pi parameter for BOS distribution.

Value

Returns the probability of ej to be sampled from a BOS distribution of parameters (mu,pi), with the number of levels equal to m.

Author(s)

Margot Selosse, Julien Jacques, Christophe Biernacki.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
  library(ordinalClust)
  data("dataqol")
  set.seed(5)

  m=7
  nr=10000
  mu=5
  pi=0.5

  probaBOS=rep(0,m)
  for (im in 1:m) probaBOS[im]=pejSim(im,m,mu,pi)
  M <- sample(1:m,nr,prob = probaBOS, replace=TRUE)

ordinalClust documentation built on Jan. 13, 2021, 8:43 a.m.