equal_unit_vec: check whether a vector is equal to a unit vector with the one...

Description Usage Arguments Value Examples

View source: R/RcppExports.R

Description

This function is used in updating Q matrix if we constrain the updates within the identifiability assumption

Usage

1

Arguments

v

the vector (a binary vector)

k

the index that is being checked if v[k] is the only one in vector v. k must be smaller than or equal to the length of k

Value

TRUE if v = \mathbf{e}_k; FALSE otherwise.

Examples

1
2
3
4
 equal_unit_vec(c(1,0,0,0,0,0),1)
 equal_unit_vec(c(1,0,0,0,0,0),2)
 equal_unit_vec(c(0,0,2,0,0,0),3)
 equal_unit_vec(c(0,0,1,0,0,0),3)

oslerinhealth/rewind documentation built on May 26, 2021, 6:56 a.m.