Skip to content
Prev 171498 / 398503 Next

replace zeros in a block diagonal matrix with small random values?

say 'mat' is your matrix, then you could try something like (untested):

ind <- mat == 0
mat[ind] <- runif(sum(ind))


I hope it helps.

Best,
Dimitris
Rick DeShon wrote: