cost calculation #9

Closed
opened 2016-04-20 13:11:18 +00:00 by distantobserver · 4 comments
distantobserver commented 2016-04-20 13:11:18 +00:00 (Migrated from github.com)

Looking at the code for calculating costs on the Joomla2 version (from line 1127) the calculations for cost of morbidity used a different format to presenteeism and mortality (see part of equation on working_days). Did this carry through to the Joomla3 version?

I don't believe it affects the end number, but for consistency - they should use brackets and operators in the same way.

Looking at the code for calculating costs on the Joomla2 version (from line 1127) the calculations for cost of morbidity used a different format to presenteeism and mortality (see part of equation on working_days). Did this carry through to the Joomla3 version? I don't believe it affects the end number, but for consistency - they should use brackets and operators in the same way.

I am not sure what you want to change, but line 1127 in version 2 correspond to line 1044 in version 3 and so yes it has been carried through.

You point out that it should be the same to presenteeism and mortality, and from what I see it clearly isn't, so on line 1117 you can see presenteeisms implementation.

Would you like to make changes to the calculations? I simply used your documentation to setup these, so to change them is very simple. Just give me the new or better calculations.

Lets use free hand notation to map the calculations:

line 1044

cost of morbidity =     gender_age_morbidity_unscaled 
                * (( total_salary / males + females) / working_days ) 
                + total_healthcare / total_morbidity_unscaled

line 1117

cost_presenteeism_unscaled =    gender_age_presenteeism_unscaled
                            * ( total_salary / (( males + females) 
                            * working_days))

Rewrite these free hand calculations to reflect how you would want it implemented, please also include the mortality version.

I am not sure what you want to change, but line [1127 in version 2](https://github.com/namibia/CBP-Joomla-2-Component/blob/master/administrator/components/com_costbenefitprojection/helpers/sum.php#L1127) correspond to line [1044 in version 3](https://github.com/namibia/CBP-Joomla-3-Component/blob/master/admin/helpers/sum.php#L1044) and so yes it has been carried through. You point out that it should be the same to presenteeism and mortality, and from what I see it clearly isn't, so on line [1117](https://github.com/namibia/CBP-Joomla-3-Component/blob/master/admin/helpers/sum.php#L1117) you can see presenteeisms implementation. Would you like to make changes to the calculations? I simply used your documentation to setup these, so to change them is very simple. Just give me the new or better calculations. Lets use free hand notation to map the calculations: [line 1044](https://github.com/namibia/CBP-Joomla-3-Component/blob/master/admin/helpers/sum.php#L1044) ``` cost of morbidity = gender_age_morbidity_unscaled * (( total_salary / males + females) / working_days ) + total_healthcare / total_morbidity_unscaled ``` [line 1117](https://github.com/namibia/CBP-Joomla-3-Component/blob/master/admin/helpers/sum.php#L1117) ``` cost_presenteeism_unscaled = gender_age_presenteeism_unscaled * ( total_salary / (( males + females) * working_days)) ``` Rewrite these free hand calculations to reflect how you would want it implemented, please also include the mortality version.
distantobserver commented 2016-04-21 15:50:33 +00:00 (Migrated from github.com)

It's just that the statements
(( total_salary / males + females) / working_days )
and
( total_salary / (( males + females) * working_days))

will produce the same result but are written inconsistently. I prefer the second one.

It's just that the statements (( total_salary / males + females) / working_days ) and ( total_salary / (( males + females) \* working_days)) will produce the same result but are written inconsistently. I prefer the second one.

So you are speaking about operator precedence. Hmmm okay I will update those for you in the next commit.

So you are speaking about operator precedence. Hmmm okay I will update those for you in the next commit.
distantobserver commented 2016-04-22 12:20:22 +00:00 (Migrated from github.com)

Thanks

Thanks
Sign in to join this conversation.
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: joomla/Cost-Benefit-Projection#9
No description provided.