Lista 06

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

Lista de Exercícios 6

Gabriela Araújo

18/07/2022

library(lifecontingencies)

## Package: lifecontingencies
## Authors: Giorgio Alfredo Spedicato [aut, cre]
## (<https://orcid.org/0000-0002-0315-8888>),
## Christophe Dutang [ctb] (<https://orcid.org/0000-0001-6732-1501>),
## Reinhold Kainhofer [ctb] (<https://orcid.org/0000-0002-7895-1311>),
## Kevin J Owens [ctb],
## Ernesto Schirmacher [ctb],
## Gian Paolo Clemente [ctb] (<https://orcid.org/0000-0001-6795-4595>),
## Ivan Williams [ctb]
## Version: 1.3.9
## Date: 2022-06-10 22:20:02 UTC
## BugReport: https://github.com/spedygiorgio/lifecontingencies/issues

library(knitr)
data("soa08Act")

RESERVAS

Exercício 1

t=4
P = Axn(soa08Act,60)/axn(soa08Act,60,5)*100000
(V = 100000*Axn(soa08Act,60+t)-P*axn(soa08Act,60+t,5-t))

## [1] 34017.86

Exercício 2

t=10
P = Axn(soa08Act,60)/axn(soa08Act,60, k=4)*100000
(V = 100000*Axn(soa08Act,60+t)-P*axn(soa08Act,60+t,k=4))

## [1] 23418.24

1
Exercício 3

t=5
P = Exn(soa08Act, 75,20)/axn(soa08Act, 75,20)*50000
(V = 50000*Exn(soa08Act, 75+t,20-t)-P*axn(soa08Act, 75+t,20-t))

## [1] 889.7223

Exercício 4

t=0:20
P1 = AExn(soa08Act, 60,20)/axn(soa08Act, 60,15)*100000

Letra a

recurrent = function(P){
V = NULL
for (t in 0:14) {
V = c(V,(100000*AExn(soa08Act, 60+t,20-t))-P*axn(soa08Act, 60+t,15-t))
}
for (t in 15:20) {
V = c(V,100000*AExn(soa08Act, 60+t,20-t))
}
return(V)
}

Letra b

y = recurrent(P1)
plot(t, y, pch=20, main="Reserva de um seguro dotal misto ao longo de 20 anos")

2
Reserva de um seguro dotal misto ao longo de 20 anos
8e+04
y

4e+04
0e+00

0 5 10 15 20

SEGUROS: Mais cálculos

Exercício 5

tab.xy = list(soa08Act,soa08Act)

(VPA = 1000*(axn(soa08Act,30, k=12) - axyzn(tab.xy,c(30,40),k=12)))

Letra a

## [1] 1650.091

(P = VPA/axyzn(tab.xy,c(30,40),n=30,k=12))

Letra b

## [1] 127.0589

3
Exercício 6

(G = ((10000*Axn(soa08Act, 30,20)/axn(soa08Act, 30,20))+30)/0.85)

## [1] 64.1457

Exercício 8

samples = 1000*rLifeContingencies(n=10000, lifecontingency="axn", object=soa08Act,


x=65, parallel=TRUE, payment="due" )
hist(samples, col = "lightgreen")

Histogram of samples
1000
Frequency

600
200
0

5000 10000 15000

samples

summary(samples)

## Min. 1st Qu. Median Mean 3rd Qu. Max.


## 1000 7802 10712 9907 12764 16138

(P.perc = quantile(samples, p=0.75))

## 75%
## 12764.08

You might also like