rppmx {ppmSuite}R Documentation

Function generates random realizations from a PPM or PPMx

Description

rppmx Employes the ploya urn sampling scheme to randomly generate a partition from the PPM or PPMx.

Usage

rppmx(m, X=NULL,
      similarity,
      simparm,
      M=1,
      m0=0,s20=1,v=2,k0=10,v0=1,alpha=1)

Arguments

m

Number of unites that are allocated to partitions

X

a data frame whose columns consist of covariates that will be incorporated in the partition model. Those with class of "character" or "factor" will be treated as categorical covaraites. All others will be treated as continuous covariates. If NULL, then a PPM partition is produced.

similarity

Type of similarity function that is employed for covariates. Options are

1 - Auxilliary similarity,

2 - Double dipper similarity

3 - variance similarity

simparm

Type of similarty model employed for continuous covariates. Options are

1 - N-N(m0, s20, v) (v variance of ”likelihood”, m0 and s20 ”prior” parameters),

2 - N-NIG(m0,k0, k0, v0, s20) (m0 and k0 center and scale of Gaussian, n0 and s20 shape and scale of IG )

M

Precision parameter. Default is 1.

m0

Continuous similarity function value (see above)

s20

Continuous similarity function value (see above)

v

Continuous similarity function value (see above)

k0

Continuous similarity function value (see above)

v0

Continuous similarity function value (see above)

alpha

Penalty value when using the variance similarity

Details

Use polya urn scheme to sample from the PPM or the PPMx

Value

The function returns randomly generated partition

Examples


X <- cbind(rnorm(100), rbinom(100,1,0.5))
p <- rppmx(m=100, X=X, similarity=1, simparm=1, M=1)
p



[Package ppmSuite version 0.3.4 Index]