Model

From Peace Corps Wiki
Revision as of 13:48, 3 November 2010 by Wikibot (Talk)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

<html><head></head><body>

The following is based on a probabilistic model and should be taken as estimates only.

Given two quantities the program will try and estimate the remaining numbers.
All values should be entered as numerical symbols only ("1234" instead of "1,234")

<form id="model" action="form_action.asp" name="model">

Actual Numbers (<a href="http://peacecorpswiki.org/images/FY2009ETdatasummary.pdf">FY2009</a>)
(as suggested starting points)
Number of Volunteers in the past year...
Worldwide
Africa
EMA
IMA
Entered Service <input type="text" name="r" value="" />
Finished Service (COS) <input type="text" name="s" value="" />
Early Terminated (ET) <input type="text" name="e" value="" /> 1155 406 382 367
Currently Serving <input type="text" name="c" value="" />
TOTAL served any part of year <input type="text" name="n" value="" /> 11549 4365 3494 3690
Rate of Early Termination:
Cohort Method <input type="text" name="p" value="" />%
Annual Method <input type="text" name="a" value="" />% 10.0% 9.3% 10.9% 9.9%
Volunteer-Year Method <input type="text" name="v" value="" />
Statistics:
Average length of service (months) <input type="text" name="L" value="" />



<input type="button" name="calc" value="Calculate" onclick=calcForm()> <input type="button" value="Clear" onClick="this.form.reset()" />

</form>


Definitions:

Entered Service Number of volunteers who entered service within the past year
Finished Service (COS) Number of volunteers who successfully completed a full service (COS) within the past year
Early Terminated (ET) Number of volunteers who early terminated their service within the past year. [FY2009 Actual value: 1,155 (<a href="http://peacecorpswiki.org/images/FY2009ETdatasummary.pdf">Ref.</a>)]
Currently Serving The average number of currently serving volunteers and trainees at any moment in time. [26May2010 Actual value: 7,340 (<a href="http://peacecorpswiki.org/images/PCVStats26May2010.pdf">Ref.</a>)]
TOTAL served any part of year The number of volunteers and trainees that served any portion of the year under study [FY2009 Actual Value: 11,549 (<a href="http://peacecorpswiki.org/images/FY2009ETdatasummary.pdf">Ref.</a>)]
Cohort Method ("Out of 100") Equivalent to the probability of a randomly selected volunteer Early Terminating sometime within their service.
Annual Method (current method used by Peace Corps) The number of PCVs/Ts who separated from the Peace Corps during the fiscal year divided by the total number of trainees and volunteers who served at any time during the fiscal year. (<a href="http://peacecorpswiki.org/Early_Termination">Ref.</a>) [FY2009 Actual Value: 10.0% (<a href="http://peacecorpswiki.org/images/FY2009ETdatasummary.pdf">Ref.</a>)]
Volunteer-Year Method
(as decimal)
The number of ET's by an average volunteer during one year of service. Since most volunteers successfully complete their service, which is longer than one year, this number would be a "fraction of an ET". If the V-Year ET Rate was 0.20 (per year) we would expect about 2 volunteers out of 10 to ET per year, or about 1 volunteer out of 10 in a six-month period. (<a href="http://peacecorpswiki.org/Early_Termination">Ref.</a>)
Average length of service
(months)
Average length of service among all volunteers (in months)


Note: [TOTAL served any part of year] = [Finished Service (COS)] + [Early Terminated (ET)] + [Currently Serving]
The volunteers who [Entered Service] are already counted in one of three categories as during that year they have either COSed, ETed, or are still currently serving.

The above probabilistic model of Peace Corps was developed by Michael Sheppard (RPCV / The Gambia), and it should be taken as an estimate only



<script language="JavaScript">

function calcForm() {

 var elements = document.model.elements;
 //Convert rates to decimals
 if (elements[5].value!="") {
 elements[5].value=1.0*elements[5].value/100;
 }
 if (elements[6].value!="") {
 elements[6].value=1.0*elements[6].value/100;
 }
 // v is decimal, by definition; while p and a are percentages


 //Compute all variables possible by continuously looping through the formulas
 var ind=1;
 while (ind==1) {
 //Initialize to zero, and set equal to one if any new variables are computed
 ind=0;
 //Order of priority, first solve for a,p,v if known
 
 //Equation : 26a=9ap+8p  (a 6, p 5)
 //Unknown  : a (6)
 if (elements[6].value=="" && elements[5].value!="") {
 document.model.elements[6].value = (8.0*elements[5].value) / (26.0 - (9.0*elements[5].value));
 ind=1;
 }
 //Equation : 26a=9ap+8p  (a 6, p 5)
 //Unknown  : p (5)
 if (elements[6].value!="" && elements[5].value=="") {
 document.model.elements[5].value = (26.0*elements[6].value) / (8.0 + (9.0*elements[6].value));
 ind=1;
 }
 //Equation : 18v=9av+26a (a 6 , v 7)
 //Unknown  : a (6)
 if (elements[6].value=="" && elements[7].value!="") {
 document.model.elements[6].value = (18.0*elements[7].value) / (26.0 + (9.0*elements[7].value));
 ind=1;
 }
 //Equation : 18v=9av+26a (a 6 , v 7)
 //Unknown  : v (7)
 if (elements[6].value!="" && elements[7].value=="") {
 document.model.elements[7].value = (26.0*elements[6].value) / (18.0 - (9.0*elements[6].value));
 ind=1;
 }
 //Equation : 18v=9pv+8p (v 7, p 5)
 //Unknown  : v (7)
 if (elements[5].value!="" && elements[7].value=="") {
 document.model.elements[7].value = (8.0*elements[5].value) / (18.0 - (9.0*elements[5].value));
 ind=1;
 }
 //Equation : 18v=9pv+8p (v 7, p 5)
 //Unknown  : p (5)
 if (elements[5].value=="" && elements[7].value!="") {
 document.model.elements[5].value = (18.0*elements[7].value) / (8.0 - (9.0*elements[7].value));
 ind=1;
 }
 //IF P=0 (OR EQUIVALENT) LOOP THROUGH NON-DIVISION ESTIMATION
 if (elements[5].value!="" && 1.0*elements[5].value==0) {
 //If exist and is zero
 document.model.elements[2].value = 0;
 var ind2=1;
 while (ind2==1) {
 //Initialize to zero, and set equal to one if any new variables are computed
 ind2=0;
 if (elements[3].value=="" && elements[4].value!="") {
   document.model.elements[3].value = 18.0*elements[4].value / 26;
   ind2=1;
 }
 if (elements[3].value!="" && elements[4].value=="") {
   document.model.elements[4].value = 26.0*elements[3].value / 18;
   ind2=1;
 }
 if (elements[0].value=="" && elements[4].value!="") {
   document.model.elements[0].value = 8.0*elements[4].value / 26;
   ind2=1;
 }
 if (elements[0].value!="" && elements[4].value=="") {
   document.model.elements[4].value = 26.0*elements[0].value / 8;
   ind2=1;
 }
 if (elements[0].value=="" && elements[3].value!="") {
   document.model.elements[0].value =  8.0*elements[3].value / 18;
   ind2=1;
 }
 if (elements[0].value!="" && elements[3].value=="") {
   document.model.elements[3].value = 18.0*elements[0].value / 8;
   ind2=1;
 }
 if (elements[0].value=="" && elements[1].value!="") {
   document.model.elements[0].value =  elements[1].value;
   ind2=1;
 }
 if (elements[0].value!="" && elements[1].value=="") {
   document.model.elements[1].value = elements[0].value;
   ind2=1;
 }
 } //While
 } //If for zero


 //Equation : a*n=e (6,4,2)
 //Unknown  : a (6)
 if (elements[6].value=="" && elements[4].value!="" && elements[2].value!="") {
 document.model.elements[6].value = (1.0*elements[2].value) / (1.0*elements[4].value);
 ind=1;
 }
 //Equation : a*n=e (6,4,2)
 //Unknown  : n (4)
 if (elements[6].value!="" && elements[4].value=="" && elements[2].value!="") {
 document.model.elements[4].value = (1.0*elements[2].value) / (1.0*elements[6].value);
 ind=1;
 }
 //Equation : a*n=e (6,4,2)
 //Unknown  : e (2)
 if (elements[6].value!="" && elements[4].value!="" && elements[2].value=="") {
 document.model.elements[2].value = (1.0*elements[6].value) * (1.0*elements[4].value);
 ind=1;
 }
 //Equation : r*p=e (0,5,2)
 //Unknown  : r (0)
 if (elements[0].value=="" && elements[5].value!="" && elements[2].value!="") {
 document.model.elements[0].value = (1.0*elements[2].value) / (1.0*elements[5].value);
 ind=1;
 }
 //Equation : r*p=e (0,5,2)
 //Unknown  : p (5)
 if (elements[0].value!="" && elements[5].value=="" && elements[2].value!="") {
 document.model.elements[5].value = (1.0*elements[2].value) / (1.0*elements[0].value);
 ind=1;
 }
 //Equation : r*p=e (0,5,2)
 //Unknown  : e (2)
 if (elements[0].value!="" && elements[5].value!="" && elements[2].value=="") {
 document.model.elements[2].value = (1.0*elements[0].value) * (1.0*elements[5].value);
 ind=1;
 }
 //Equation : c*v=e (3,7,2)
 //Unknown  : c (3)
 if (elements[3].value=="" && elements[7].value!="" && elements[2].value!="") {
 document.model.elements[3].value = (1.0*elements[2].value) / (1.0*elements[7].value);
 ind=1;
 }
 //Equation : c*v=e (3,7,2)
 //Unknown  : v (7)
 if (elements[3].value!="" && elements[7].value=="" && elements[2].value!="") {
 document.model.elements[7].value = (1.0*elements[2].value) / (1.0*elements[3].value);
 ind=1;
 }
 //Equation : c*v=e (3,7,2)
 //Unknown  : e (2)
 if (elements[3].value!="" && elements[7].value!="" && elements[2].value=="") {
 document.model.elements[2].value = (1.0*elements[3].value) * (1.0*elements[7].value);
 ind=1;
 }
 //Equation : n=r+c (4,0,3)
 //Unknown  : n (4)
 if (elements[4].value=="" && elements[0].value!="" && elements[3].value!="") {
 document.model.elements[4].value = (1.0*elements[0].value) + (1.0*elements[3].value);
 ind=1;
 }
 //Equation : n=r+c (4,0,3)
 //Unknown  : r (0)
 if (elements[4].value!="" && elements[0].value=="" && elements[3].value!="") {
 document.model.elements[0].value = (1.0*elements[4].value) - (1.0*elements[3].value);
 ind=1;
 }
 //Equation : n=r+c (4,0,3)
 //Unknown  : c (3)
 if (elements[4].value!="" && elements[0].value!="" && elements[3].value=="") {
 document.model.elements[3].value = (1.0*elements[4].value) - (1.0*elements[0].value);
 ind=1;
 }
 //Equation : r=s+e (0,1,2)
 //Unknown  : r (0)
 if (elements[0].value=="" && elements[1].value!="" && elements[2].value!="") {
 document.model.elements[0].value = (1.0*elements[1].value) + (1.0*elements[2].value);
 ind=1;
 }
 //Equation : r=s+e (0,1,2)
 //Unknown  : s (1)
 if (elements[0].value!="" && elements[1].value=="" && elements[2].value!="") {
 document.model.elements[1].value = (1.0*elements[0].value) - (1.0*elements[2].value);
 ind=1;
 }
 //Equation : r=s+e (0,1,2)
 //Unknown  : e (2)
 if (elements[0].value!="" && elements[1].value!="" && elements[2].value=="") {
 document.model.elements[2].value = (1.0*elements[0].value) - (1.0*elements[1].value);
 ind=1;
 }
 //Equation : 2L+27p=54 (8,5)
 //Unknown  : L (8)
 if (elements[8].value=="" && elements[5].value!="") {
 document.model.elements[8].value = (54.0 - (27.0*elements[5].value)) / 2.0;
 ind=1;
 }
 //Equation : 2L+27p=54 (8,5)
 //Unknown  : p (5)
 if (elements[8].value!="" && elements[5].value=="") {
 document.model.elements[5].value = (54.0 - (2.0*elements[8].value)) / 27.0;
 ind=1;
 }
 //Equation : (1/a)=(1/p)+(1/v)  (6 5 7)
 //Unknown  : a (6)
 if (elements[6].value=="" && elements[5].value!="" && elements[7].value!="") {
 document.model.elements[6].value = 1 / ((1/(1.0*elements[5].value)) + (1/(1.0*elements[7].value)));
 ind=1;
 }
 //Equation : (1/a)=(1/p)+(1/v)  (6 5 7)
 //Unknown  : p (5)
 if (elements[6].value!="" && elements[5].value=="" && elements[7].value!="") {
 document.model.elements[5].value = 1 / ((1/(1.0*elements[6].value)) - (1/(1.0*elements[7].value)));
 ind=1;
 }
 //Equation : (1/a)=(1/p)+(1/v)  (6 5 7)
 //Unknown  : v (7)
 if (elements[6].value!="" && elements[5].value!="" && elements[7].value=="") {
 document.model.elements[7].value = 1 / ((1/(1.0*elements[6].value)) - (1/(1.0*elements[5].value)));
 ind=1;
 }
 //Equation : s=(1-p)*r (1 5 0)
 //Unknown  : s (1)
 if (elements[1].value=="" && elements[5].value!="" && elements[0].value!="") {
 document.model.elements[1].value=(1-(1.0*elements[5].value))*(1.0*elements[0].value);
 ind=1;
 }
 //Equation : s=(1-p)*r (1 5 0)
 //Unknown  : p (5)
 if (elements[1].value!="" && elements[5].value=="" && elements[0].value!="") {
 document.model.elements[5]=1-((1.0*elements[1].value)/(1.0*elements[0].value));
 ind=1;
 }
 //Equation : s=(1-p)*r (1 5 0)
 //Unknown  : r (0)
 if (elements[1].value!="" && elements[5].value!="" && elements[0].value=="") {
 document.model.elements[0].value = (1.0*elements[1].value) / (1-(1.0*elements[5].value));
 ind=1;
 }
 } // While loop

//Now that while loop is completed format all answers if (elements[0].value!="") document.model.elements[0].value=Math.round(elements[0].value); if (elements[1].value!="") document.model.elements[1].value=Math.round(elements[1].value); if (elements[2].value!="") document.model.elements[2].value=Math.round(elements[2].value); if (elements[3].value!="") document.model.elements[3].value=Math.round(elements[3].value); if (elements[4].value!="") document.model.elements[4].value=Math.round(elements[4].value); if (elements[5].value!="") document.model.elements[5].value=Math.round(1000*elements[5].value)/10; if (elements[6].value!="") document.model.elements[6].value=Math.round(1000*elements[6].value)/10; if (elements[7].value!="") document.model.elements[7].value=Math.round(100*elements[7].value)/100; if (elements[8].value!="") document.model.elements[8].value=Math.round(10*elements[8].value)/10;

}



</script>


</body></html>