Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^4: Calculate log of matrix values

by BillKSmith (Chaplain)
on Aug 09, 2013 at 19:59 UTC ( #1048836=note: print w/ replies, xml ) Need Help??


in reply to Re^3: Calculate log of matrix values
in thread Calculate log of matrix values

I did misunderstand your intention. However I still do not understand your solution. If I assume that the zero data is really a small positive number that displays as '0.00', its log should be a negative number whose magnatude exceeds any of the other logs. (e.g. log(0.001) = -6.9) Setting the log to zero assumes that the raw value is e (2.71...). Note: All other values are between .001 (log(.01) = -4.6) and .99 (log(.99) = -.01).

Bill


Comment on Re^4: Calculate log of matrix values
Re^5: Calculate log of matrix values
by BrowserUk (Pope) on Aug 09, 2013 at 20:08 UTC
    Setting the log to zero ...

    I didn't suggest setting the log to zero. Or mention doing anything to the logs.

    its log should be a negative number whose magnatude exceeds any of the other logs.

    And if you set values that are 0(.00000) to 1e-308, then when their logs are taken, they become

    say log(1e-308);; -709.196208642166

    which fulfills your "negative number whose magnatude exceeds any of the other logs." in spades.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      What a difference a day makes. Of course it is an excelent idea to replace the zero in the raw data with a small number (Especially if there is reason to believe that the zero is the result of truncation.)
      Bill

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1048836]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (8)
As of 2014-12-25 23:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (163 votes), past polls