Ok. Here are the new charts.
1) my formula: https://statsdemo.s3.amazonaws.com/2009-08-25-indeyets.html I had an error, originally, which resulted in "too flat" graphs last time. it is fixed now (formula is still the same) 2) formula made using Niels's advice to work with relative data https://statsdemo.s3.amazonaws.com/2009-08-25-xfade.html In PHP it looks like this: $rating = ($yesterday * 0.999); if ($avg_d_week + $avg_d_last_week > 0) $rating += (($avg_d_week - $avg_d_last_week) / ($avg_d_week + $avg_d_last_week)); if ($avg_c_week + $avg_c_last_week > 0) $rating += (($avg_c_week - $avg_c_last_week) / ($avg_c_week + $avg_c_last_week)); if ($avg_v_week + $avg_v_last_week > 0) $rating += (($avg_v_week - $avg_v_last_week) / ($avg_v_week + $avg_v_last_week)); 3) Formula suggested by Andrew didn't work. Result was too chaotic because of "2 * sqrt($today_time - $last_update_time)" 4) Here is "raw-data" I used for testing (this is the dump of 2 mysql tables) https://statsdemo.s3.amazonaws.com/2009-08-25-SQL.zip And php-code I use for generating ratings-data and html-demo: https://statsdemo.s3.amazonaws.com/php-code.zip convert.php is supposed to be executed using command-line php index2.php can be used with web-version of php or from CLI and redirected to file. ratings-table which is supposed to exist by these php-files: CREATE TABLE `ratings` ( `product` int(11) NOT NULL default '0', `rdate` date NOT NULL default '0000-00-00', `rating` double default NULL, PRIMARY KEY (`product`,`rdate`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- Alexey Zakhlestin http://www.milkfarmsoft.com/ Sent from St Petersburg, Russian Federation _______________________________________________ maemo-community mailing list [email protected] https://lists.maemo.org/mailman/listinfo/maemo-community
