\n");}
else{
//person 01
if ($zinssatz_==null){$zinssatz_='0';}
$zinssatz_=intval($zinssatz_);
$zinssatz=round($zinssatz_,3);
$zinssatz=$zinssatz/100; //--wird in der Formel benötigt, ist dann einfacher-------
if ($perioden_pro_jahr_==null){$perioden_pro_jahr_='1';}
$perioden_pro_jahr=intval($perioden_pro_jahr_);
if ($land_==null){$land_='usa';}
$land=$land_;
if ($barwert_==null){$barwert_='0';}
$barwert_=intval($barwert_);
$barwert=round($barwert_,2);
if ($alter__01==null){$alter__01='0';}
$alter_01=intval($alter__01);
if ($fx_==null){$fx_='100';}
$fx=intval($fx_)/100;
if ($geschlecht__01==null){$geschlecht__01='m';}
$geschlecht_01=$geschlecht__01; //müßte nicht sein
if ($zahlbar_==null){$zahlbar_='v';}
$zahlbar=$zahlbar_; //müßte nicht sein
if ($rate__01==null){$rate__01='0';}
$rate_01=intval($rate__01);
$rate_01=round($rate_01,2);
$rate=$rate_01; //wird weiter unten verwendet
if ($aufschub_==null){$aufschub_='0';}
$aufschub=intval($aufschub_);
if ($laengere_leben_==null){$laengere_leben_='ein';}
if ($dauer_==null){$dauer_='0';}
$dauer=intval($dauer_);
//person 02
if ($alter__02==null){$alter__02='0';}
$alter_02=intval($alter__02);
if ($geschlecht__02==null){$geschlecht__02='w';}
$geschlecht_02=$geschlecht__02; //müßte nicht sein
if ($fy_==null){$fy_='100';}
$fy=intval($fy_)/100;
//Höhe des Übergangs der Leibrente an Mann oder Frau--
$fxy=($fx+$fy)-1;
//lx erste Person auslesen-------------------------------------------------------------------
if ($land=='deutschland'){$tabelle_sterbetafel='dt_2005_2007';}
if ($land=='oesterreich'){$tabelle_sterbetafel='oesterreich_2000_2002';}
if ($land=='italien'){$tabelle_sterbetafel='suedtirol_2007';}
if ($land=='usa'){$tabelle_sterbetafel='usa_2006';}
if ($land=='ca'){$tabelle_sterbetafel='ca_2000_2002';}
//echo($tabelle_sterbetafel . 'bravo lois');
$zahler=0;
$abfrage= "SELECT * FROM " . $tabelle_sterbetafel . " where Geschlecht = '" . $geschlecht_01 . "'";
$q = mysql_query($abfrage);
while($r = mysql_fetch_array($q) ){
$alter_tab_01= $r[Alter];
$lx_01[$zahler]=$r[lx];
$zahler=$zahler+1;
}
//lx zweite Person auslesen und Dx berechnen--------------------------------------------------------
$zahler=0;
$abfrage= "SELECT * FROM " . $tabelle_sterbetafel . " where Geschlecht = '" . $geschlecht_02 . "'";
//echo ($abfrage);
$q = mysql_query($abfrage);
while($r = mysql_fetch_array($q) ){
$alter_tab_02= $r[Alter];
$lx_02[$zahler]=$r[lx];
$zahler=$zahler+1;
}
//---Datenbank schließen
mysql_close($link);
//----------------------
//---aex person 1 berechnen
if ($laengere_leben_=='ein'){
$aex= aex_berechnen("wftcom_sterbetabelle", $zinssatz_,$perioden_pro_jahr_,$alter_01,$geschlecht_01,$zahlbar_,$aufschub_,$dauer_,$zahlbar);
//echo("bravo Lois, der aex lautet".$aex." ".$zinssatz_."
");
//---aex person 2 berechnen
$aey= aex_berechnen("wftcom_sterbetabelle", $zinssatz_,$perioden_pro_jahr_,$alter_02,$geschlecht_02,$zahlbar_,$aufschub_,$dauer_,$zahlbar);
//("bravo Lois, der aey lautet".$aey."
");
}
//lxy errechnen-------------------------
$altersdiff=$alter_01-$alter_02;
if ($altersdiff<=0){
//alter 2 größer als alter 2
for($i=0;$i');
}
}else{
for($i=0;$i');
}
}
//DX errechnen------------------------------------------------
if($altersdiff>0){$altersdiff=0;} //??weiß nicht warum, stimmt aber so
for($i=0;$i');
}
$zahler=sizeof($lx_01);
$Nx[$zahler-1]=$Dxy[$zahler-1]+$Dxy[$zahler];
for($i = $zahler-1; $i >-1; $i--)
{
$Nx[$i]=$Nx[$i+1]+$Dxy[$i];
//echo ('NX='.$Nx[$i] . 'Dx='.$Dxy[$i].'
');
}
//korrektur bei periodischer, z. B. monatlicher Zahlung
//echo "barwert " . $barwert . $rate;
if(($alter_01!=0) && ($alter_02!=0) && (($barwert != 0)||($rate!=0))){
$teil_01=($perioden_pro_jahr-1)/(2*$perioden_pro_jahr);
$teil_02=pow($perioden_pro_jahr,2);
$teil_03=6*pow($perioden_pro_jahr,2);
$teil_04=$zinssatz*(1-($zinssatz/2));
$zinskorrektur=$teil_01 + ($teil_02/$teil_03)*$teil_04;
$alter=$alter_01; //probe - ist nicht sicher richtig
//Beispielrechung normale Leibrente
if ($aufschub==0 && $dauer==0){
$aexy=$Nx[$alter]/$Dxy[$alter];
//wenn nachschüssig----
if ($zahlbar=='n'){$aexy=$aexy-1;}
//echo ('zinskorr='. $zinskorrektur . ' ' .$aex . 'NX='.$Nx[$alter] . 'Dx='.$Dx[$alter].'
');
if($barwert==0){
$aexy=$aexy-$zinskorrektur;
if ($laengere_leben_!='ein'){$verb_leben_korr=$aexy;
}else{$verb_leben_korr=$fx*$aex+$fy*$aey-$fxy*$aexy;}
//echo "fx = ".$fx. " aex ".$aex."fy =".$fy." aey = ".$aey." fxy = ".$fxy. " aexy = ".$aexy;
//echo "verb_leben_korr " . $verb_leben_korr;
$barwert=$rate*$perioden_pro_jahr*$verb_leben_korr;
//$barwert=$rate*(($aexy-$zinskorrektur)*$perioden_pro_jahr);
$barwert=round($barwert,2);
}else{
$aexy=$aexy-$zinskorrektur;
if ($laengere_leben_!='ein'){$verb_leben_korr=$aexy;
}else{$verb_leben_korr=$fx*$aex+$fy*$aey-$fxy*$aexy;}
//echo "fx = ".$fx. " aex ".$aex."fy =".$fy." aey = ".$aey." fxy = ".$fxy. " aexy = ".$aexy;
//echo "verb_leben_korr " . $verb_leben_korr;
$rate=$barwert/($verb_leben_korr*$perioden_pro_jahr);
$rate=round($rate,2);
}
}
//bei aufgeschobener Leibrente
elseif ($aufschub>0 && $dauer==0){
$aexy=$Nx[$alter+$aufschub]/$Dxy[$alter];
//wenn nachschüssig----
if ($zahlbar=='n'){$aexy=$aexy-1;}
$aexy=$aexy-$zinskorrektur;
if ($laengere_leben_!='ein'){$verb_leben_korr=$aexy;
}else{$verb_leben_korr=$fx*$aex+$fy*$aey-$fxy*$aexy;}
//echo ('zinskorr='. $zinskorrektur . ' ' .$aex . 'NX='.$Nx[$alter] . 'Dx='.$Dx[$alter].'
');
if($barwert==0){
$barwert=$rate*($verb_leben_korr*$perioden_pro_jahr);
$barwert=round($barwert,2);
}else{
$rate=$barwert/($verb_leben_korr*$perioden_pro_jahr);
$rate=round($rate,2);
}
}
//bei temporärer Leibrente
elseif ($aufschub==0 && $dauer>0){
$aexy=($Nx[$alter]-$Nx[$alter+$dauer])/$Dxy[$alter];
//wenn nachschüssig----
if ($zahlbar=='n'){$aexy=($Nx[$alter+1]-$Nx[$alter+$dauer+1])/$Dxy[$alter];}
$aexy=$aexy-$zinskorrektur;
if ($laengere_leben_!='ein'){$verb_leben_korr=$aexy;
}else{$verb_leben_korr=$fx*$aex+$fy*$aey-$fxy*$aexy;}
//echo ('zinskorr='. $zinskorrektur . ' ' .$aex . 'NX='.$Nx[$alter] . 'Dx='.$Dx[$alter].'
');
if($barwert==0){
$barwert=$rate*($verb_leben_korr*$perioden_pro_jahr);
$barwert=round($barwert,2);
}else{
$rate=$barwert/($verb_leben_korr*$perioden_pro_jahr);
$rate=round($rate,2);
}
}
//bei temporärer und aufgeschobener Leibrente
elseif ($aufschub>0 && $dauer>0){
$aexy=($Nx[$alter+$aufschub]-$Nx[$alter+$aufschub+$dauer])/$Dxy[$alter];
//wenn nachschüssig----
if ($zahlbar=='n'){$aexy=($Nx[$alter+$aufschub+1]-$Nx[$alter+$aufschub+$dauer+1])/$Dxy[$alter];}
$aexy=$aexy-$zinskorrektur;
if ($laengere_leben_!='ein'){$verb_leben_korr=$aexy;
}else{$verb_leben_korr=$fx*$aex+$fy*$aey-$fxy*$aexy;}
//echo ('zinskorr='. $zinskorrektur . ' ' .$aex . 'NX='.$Nx[$alter] . 'Dx='.$Dx[$alter].'
');
if($barwert==0){
$barwert=$rate*($verb_leben_korr*$perioden_pro_jahr);
$barwert=round($barwert,2);
}else{
$rate=$barwert/($verb_leben_korr*$perioden_pro_jahr);
$rate=round($rate,2);
}
}
$uebergangsrente_01=$rate*$fx;
$uebergangsrente_02=$rate*$fy;
}
//
}
?>
|
Here you can calculate the life annuity for connected lives;
this is a pension you get until the end of life in consideration to a real estate such as an apartment, a home ect. as well as a certain amount of money. They are bound on the life expectancy of two connected peaple, for example a couple. Basis for the calculation of life annuities are life tables. (Vital statistics of the population of a Country). This calculations are baset on the United States Life Tables, 2003 and the Canacian Life Tables, 2002_2003
|
|
Life annuity
Life annuitys are periodic payments until the end of life of the recipient. They are bound on the life expectancy of the pensioner. They are purchased by one-time payments (eg sale of a house on annuity) or ongoing contributions (deferred annuity). Basis for the calculation of life annuities are life tables. (Vital statistics of the population of a Country).
A typical example of the life annuity is the sale of a house. The purchase agreement is, that the buy price is payed only partially (or not at all). Instead of paying immediately, the buyer has to pay a certain ammount as a peridoic annuity until the death of the seller.
The contrakt for a life annuity for connected lives is closed for the life of two persons p.a. a married couple, business partner, etc. The contract can agree, that the life annuity is to be payed until the demision of the two persons. In this case, a certain annuity is to be payed until the demision of one person. After this, the annuity (or a part of it) is to be payed until the demision of the other person. One speaks from a life annuity for the longer life.
One speaks of the life annuity for the shorter life if the contract prevents a payment of the life annuity only until the demision of one person.
Instructions for using the life annuity calculator:
Present value: The present value is the amount, wich should be used for the life annuity, for example, the proceeds of sale or an accumulated amount of money. You can calculate the life annuity, if the Present value is known or the present value, if the life anniuty is known.
Interest Rate: Enter the agreed interest rate in the appropriate field.
Payment period: Select the payment period of the life annuity.
Life annuity for connected lives: The contract can be closed as "life annuity for the longer life" or as "life annuity for the shorter life"
Information relating to connected persons: Enter the gender and the age of the two connected persons. If you want to calculate a life annuity for the longer life, enter the the percentage (0 to 100) of the pension, which is to be payed after the demision of a person. The percentage can be different for each person.
Collective annuity: If you have entered the present value, the live annuity is calculated. If you wish to receive a certain life annuity, enter it and calculate the necessary present value.
Life annuity of the first (second) person: Will be calculated and can not be changed.
Calculate: Click on 'Calculate' to calculate the life annuity.
Delete entries: deletes all entries.
|
|
|
|