Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function make_county_prediction($county,$start,$count,$t,$dt){
- global $core;
- $return = '';
- $start = new DateTime ($start, new DateTimeZone ('UTC'));
- $end = new DateTime (' +30 days', new DateTimeZone ('UTC'));
- $interval = new DateInterval ('P1D');
- $range = new DatePeriod ($start, $interval, $end);
- $N = $count; // total cases
- $Nmax = total_count($county); // population
- $a = '0.394'; // percentage daily infection rate
- foreach ($range as $date) {
- $out = $date->format ('Y-m-j');
- //$N=$N+$a*(1-$N/$Nmax)*$N*$dt;
- //$t=$t+$dt;
- $Nold=$N;
- $N=$N+$a*(1-$N/$Nmax)*$N*$dt;
- $r=($N-$Nold)/$dt;
- $return .= '{ label: "'.$out.'", y: '.$r.' }, ';
- }
- return $return;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement