Loading ...
Sorry, an error occurred while loading the content.

log-likelifood

Expand Messages
  • ma3yak88
    Hi, All. If someone can tell me how to calculate the log-likelifood value listed on page 730, -2044, please help me! I tried to calculate this by below code(in
    Message 1 of 1 , Nov 21, 2004
    • 0 Attachment
      Hi, All.

      If someone can tell me how to calculate the log-likelifood value
      listed on page 730, -2044, please help me!
      I tried to calculate this by below code(in Java language),
      but I got such an odd value, -4041...
      What was wrong?? I'm totally confused...

      Thanks a lot.

      -- code below
      double[] values = new double[7];
      // for bag
      values[0] = log(0.6) * (1000 * 0.6) + log(0.4) * (1000 * 0.4);
      // for flavor (560 for total number of cherry)
      values[1] = log(0.6) * (560 * 0.6) + log(0.4) * (440 * 0.6);
      values[2] = log(0.4) * (560 * 0.4) + log(0.6) * (440 * 0.4);
      // for wrapper (545 for total number of red wrapper)
      values[3] = log(0.6) * (545 * 0.6) + log(0.4) * (455 * 0.6);
      values[4] = log(0.4) * (545 * 0.4) + log(0.6) * (455 * 0.4);
      // for hole (550 for total number of holed)
      values[5] = log(0.6) * (550 * 0.6) + log(0.4) * (450 * 0.6);
      values[6] = log(0.4) * (550 * 0.4) + log(0.6) * (450 * 0.4);

      * log() means Math.log(value) / Math.log(2)
    Your message has been successfully submitted and would be delivered to recipients shortly.