R/RcppExports.R
attribute_bijection.Rd
Computes the powers of 2 from 0 up to K−1 for K-dimensional attribute pattern.
attribute_bijection(K)
K | Number of Attributes. |
---|
A vec
with length K detailing the power's of 2.
The bijection vector generated is v=(2K−1,2K−2,…,1)⊤. With the bijection vector, there is a way to map the binary latent class with c=α⊤cv∈{0,1,…,2K−1}. For example, for K=2, v=(2,1)⊤ and the integer representations for attribute profiles α0=(0,0)⊤, α1=(0,1)⊤, α2=(1,0)⊤, and α3=(1,1)⊤ are c = 0, 1, 2, and 3, respectively.
Steven Andrew Culpepper and James Joseph Balamuta
## Construct an attribute bijection for binary data ---- bijection_k3 = attribute_bijection(3) bijection_k3#> [,1] #> [1,] 4 #> [2,] 2 #> [3,] 1