Round off error in the database?
#21
Originally posted by Jason@Sep 9th 2004 @ 7:58 PM
Ah. Looks like that was the problem. I reset the variables when the script looped (recalculating all of the overall mileages) and it appears to have worked. Please double-check me on that.
Ah. Looks like that was the problem. I reset the variables when the script looped (recalculating all of the overall mileages) and it appears to have worked. Please double-check me on that.
Andy, thanks for being such a careful observer!
Andy
P.S. Oh, I was really busy at work yesterday. I was going to take a look at your code fragment last night but my home PC blow up. Took me all night to find out it's the video card and swap in an old card.
#22
Hi Jason:
___I thought we had discussed the lmpg inaccuracy a few months ago with Rick Reese’s and my own tanks but I didn’t find the thread? In any case, my current spreadsheet lmpg now matches up with the database lmpg almost exactly. Wait until I post my next tank at which time my spreadsheet, my lmpg, and the database will finally match because it is going to be a good one
___Accwai, thanks for leaning on Jason for the accuracy fix. I always thought it was a significant digit problem and kept hammering on Jason to fix that to make the lmpg numbers match. Significant Database Updates, By Popular Request * tenth post + down …
___Good Luck
___Wayne R. Gerdes
___Hunt Club Farms Landscaping Ltd.
___Waynegerdes@earthlink.net
___I thought we had discussed the lmpg inaccuracy a few months ago with Rick Reese’s and my own tanks but I didn’t find the thread? In any case, my current spreadsheet lmpg now matches up with the database lmpg almost exactly. Wait until I post my next tank at which time my spreadsheet, my lmpg, and the database will finally match because it is going to be a good one
___Accwai, thanks for leaning on Jason for the accuracy fix. I always thought it was a significant digit problem and kept hammering on Jason to fix that to make the lmpg numbers match. Significant Database Updates, By Popular Request * tenth post + down …
___Good Luck
___Wayne R. Gerdes
___Hunt Club Farms Landscaping Ltd.
___Waynegerdes@earthlink.net
#23
Right, I remember that. I think the error was blamed on rounding, however. Unless I don't recall correctly, I assumed that whole-number distances and tenths-digit mileages was creating the abberance.
Ah, well. No reason to dwell on the past. It's fixed.
Ah, well. No reason to dwell on the past. It's fixed.
#26
Originally posted by Jason@Sep 10th 2004 @ 11:56 PM
Looks like things aren't absolutely perfect after all... I see a "highway" percentage in the 90's while every tank's percentage was 0-33. I'll look into it. These are sort of useless variables, anyway
Looks like things aren't absolutely perfect after all... I see a "highway" percentage in the 90's while every tank's percentage was 0-33. I'll look into it. These are sort of useless variables, anyway
#29
Andy, for the life of me I cannot figure out why these values are wrong. If it works for mileage, why not the others, as well?
Code:
if ($weight['mileage'] != 0) { $mileagedenominator = $mileagedenominator + $weight['distance']/$weight['mileage']; } if ($weight['temperature'] != 0) { $temperaturedenominator = $temperaturedenominator + $weight['distance']/$weight['temperature']; } if ($weight['time'] != 0) { $timedenominator = $timedenominator + $weight['distance']/$weight['time']; } if ($weight['highway'] != 0) { $highwaydenominator = $highwaydenominator + $weight['distance']/$weight['highway']; } if ($weight['traffic'] != 0) { $trafficdenominator = $trafficdenominator + $weight['distance']/$weight['traffic']; } $numerator= $numerator + $weight['distance']; if ($mileagedenominator != 0) { $mileage = $numerator / $mileagedenominator; } if ($temperaturedenominator != 0) { $temperature = round($numerator / $temperaturedenominator,0); } if ($timedenominator != 0) { $time = round($numerator / $timedenominator,0); } if ($highwaydenominator != 0) { $highway = $numerator / $highwaydenominator; } if ($trafficdenominator != 0) { $traffic = $numerator / $trafficdenominator; }
#30
Side note: the main bar graph was running on numbers rounded to the tenth insteaded to the whole number. The drawing software rounded these values down. This has been fixed, resulting in a Prius II average of 50 instead of 49.
Side note #2: I am contemplating changing these values to medians instead of means in order to dissassociate "hypermilers."
Side note #2: I am contemplating changing these values to medians instead of means in order to dissassociate "hypermilers."
Thread
Topic Starter
Forum
Replies
Last Post