Computationally hazardous(!), but you could try one of these modifications with e.g. 1e-300 as an approximation for zero and see how far you get... Take care of error propagation.
$lnpam[$i][$j] = log( $matrix[$i][$j] || 1e-300);
$lnpam[$i][$j] = $matrix[$i][$j] ? log( $matrix[$i][$j]) : -1000;
In reply to Re: Calculate log of matrix values
by Perlbotics
in thread Calculate log of matrix values
by madM
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |