utilall: Calculate utility of total consumption and bequest (FAST...

Description Usage Arguments Value Examples

View source: R/UTILALL.R

Description

Expected Utility for total cash-flows is calculated here and used for optimization

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
utilall(
  ret_age,
  tw3,
  c,
  c2,
  nu2,
  nu3,
  ra,
  delta,
  alpha,
  beta,
  c_age,
  gender,
  gender_mortalityTable2,
  w0,
  CF,
  li,
  lg,
  c1,
  s1,
  s2,
  s3,
  rho2,
  rho3,
  ret,
  retr,
  SPFretsel,
  psi,
  verbose = FALSE,
  warnings = TRUE
)

Arguments

ret_age

Decision Variable: retirement age, can be set anywhere between 60 and 70 (default: 65)

tw3

Decision Variable: third pillar portfolio allocation (given either as vector or as matrix with entries) for all years. HERE: Choose only allocation to stocks, bonds and real estate, cash will be determined as fraction missing to sum up to one

c

Decision Variable: fraction of income that is consumed while still working (current assumption: constant)

c2

Decision Variable: second pillar savings as fraction of gross income (still missing: health, a-fonds-perdu payments)

nu2

Decision Variable: fraction of second pillar savings that is converted to life-long pension

nu3

Decision Variable: fraction of third pillar savings that is converted to life-long pension

ra

Given variable: Risk Aversion of Agent

delta

Given Variable: Time Preference

alpha

parameter to choose fraction of wealth NOT consumed during retirement but kept for investment (and subsequent consumption) - see file 'Consumption_3p.ods'

beta

Given variable: Relative Weight of bequest utility

c_age

Given variable: the investor's current age (assuming birthday is calculation-day)

gender

Given variable: gender, 0=male and 1=female

gender_mortalityTable2

Given variable: Combined MortalityTable with columns for both gender 0=male and 1=female, e.g. 'baseTable(AVOe2005R.male)'

w0

Given variable: time c_age wealth that is not disposable, assumption: still available at retirement (no growth or decline), alternatively: expected wealth (that is not disposable) at retirement, stays the same over time

CF

Given Variables: income shocks, such as inheritance (not currrently imlemented)

li

Given variable: gross labor income at time 0 (in the last year before birthday)

lg

Given variable: labor growth rate (in real terms, constant)

c1

Given variable: first pillar savings as fraction of gross income

s1

Given variable: vector consisting of two components: c(number of contribution years at age=c_age,historical average yearly income until c_age)

s2

Given variable: savings in second pillar as of t=0

s3

Given variable: liquid wealth - invested in the third pillar (current assumption: no tax advantage for third pillar)

rho2

Given variable: conversion factor in second pillar for regular retirement age

rho3

Given variable: conversion factor in third pillar for regular retirement age

ret

Given variable: investment return scenarios (nominal)

retr

Given variable: investment return scenarios (real)

psi

Given variable: spread to take a loan/leverage for third pillar savings

verbose

optional: show additional information while calculating utility (default: FALSE)

warnings

optional: should warnings be given? (default=TRUE)

Value

Expected utility

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
data(ret); data(retr); data(SPFret)
MortalityTables::mortalityTables.load("Austria_Annuities")
.load_parameters(gend=0,type=1)
SPFretsel <- .SPFretch(SPFret,c_age=c_age,ret_age=ret_age)

utilall_ex <- utilall(ret_age=ret_age,c_age=c_age,
                tw3=c(.25,.25,.25),
                c=cc,c2=c2,nu2=nu2,nu3=nu3,ra=ra,delta=delta,alpha=aalpha,
                beta=bbeta,gender=gender,
                gender_mortalityTable2=cbind(MortalityTables::baseTable(AVOe2005R.male),
                MortalityTables::baseTable(AVOe2005R.female)),
                w0=w0,CF=NULL,li=li,lg=lg,c1=c1,s1=s1,s2=s2,s3=s3,
                rho2=rho2,rho3=rho3,ret=ret,retr=retr,SPFretsel=SPFretsel,psi=psi)

.load_parameters(gend=1,type=2)
SPFretsel <- .SPFretch(SPFret,c_age=c_age,ret_age=ret_age)
utilall_ex2 <- utilall(ret_age=ret_age,c_age=c_age,
                tw3=c(.25,.25,.25),
                c=cc,c2=c2,nu2=nu2,nu3=nu3,ra=ra,delta=delta,alpha=aalpha,
                beta=bbeta,gender=gender,
                gender_mortalityTable2=cbind(MortalityTables::baseTable(AVOe2005R.male),
                MortalityTables::baseTable(AVOe2005R.female)),
                w0=w0,CF=NULL,li=li,lg=lg,c1=c1,s1=s1,s2=s2,s3=s3,
                rho2=rho2,rho3=rho3,ret=ret,retr=retr,SPFretsel=SPFretsel,psi=psi)

sstoeckl/pensionfinanceLi documentation built on Dec. 2, 2020, 3:26 a.m.