Learn R Programming

PopED (version 0.3.2)

test_for_zeros: Test if any matrix element is zero.

Description

Function tests is any matrix element is zero. For those elements the function sets those values to the minimum value allowed (not zero). This is used to avoid numerical problems in the FIM calculation.

Usage

test_for_zeros(mat, ourzero)

Arguments

mat

A matrix.

ourzero

A matrix the same size as mat with the value that zero should be reassigned to.

Value

A matrix

See Also

Other matrix_manipulation: diag_matlab, test_for_max, test_for_min

Examples

Run this code
# NOT RUN {
test_for_zeros(cbind(2,3,0,5,6),1e-18)

test_for_zeros(zeros(6),1e-7)

test_for_zeros(cbind(1,2,3,NA,0),1e-5)



# }

Run the code above in your browser using DataLab