Publications by Mauricio Rodriguez Abreu
Lifecontingencies
R Markdown Usando R Markdown se pueden compartir mejor los resultados de R. Todo lo que se incluya en los recuadros corresponde a lineas de codigo. Recuerda que el primer paso consiste en cargar el paquete que usaremos: library(lifecontingencies) ## Package: lifecontingencies ## Authors: Giorgio Alfredo Spedicato [aut, cre] ## (<https://orc...
4279 sym R (2576 sym/37 pcs)
LAT4082_S5
R Markdown Severity distributions We can start with the exponential distribution [ f_X(x)= e^{-x} ] x<-c(0:50) x<-c(0:50) plot(x,dexp(x,0.005),xlab="x",ylab="f(x)",type="l",col="blue") plot(x,dexp(x,0.01),xlab="x",ylab="f(x)",type="l",col="blue") plot(x,dexp(x,0.05),xlab="x",ylab="f(x)",type="l",col="blue") plot(x,dexp(x,0.1),xlab="x",ylab="...
564 sym R (3910 sym/29 pcs) 11 img
LAT4072_S5
R Markdown Social security and pensions setwd("C:/Users/23043/Dropbox/UDLAP/Cursos/2022 Primavera/Pensiones y SS/Datos") base<-read.csv("datos1.csv") head(base) ## ID Age Gender Weeks Salary Marital AgeSp Ch1 Ch2 Ch3 Par1 Par2 DisP ## 1 1 64 1 2269 332.27 1 62 -1 -1 -1 -1 -1 0.8898 ## 2 2 53 1 1712 412.30 ...
2152 sym R (7770 sym/40 pcs)
DocumentLAT4082_S4
First, lets define the elements for our problem. In this scenario we need the probability function: xval<-c(0:3) prob<- c(0.1,0,0.4,0.5) pf<- cbind(xval,prob) We have the same information than before, as we can see pf ## xval prob ## [1,] 0 0.1 ## [2,] 1 0.0 ## [3,] 2 0.4 ## [4,] 3 0.5 Now, lets use a library that was ...
2255 sym R (6079 sym/55 pcs) 10 img
LAT4082_S3
The context From our session, we learn that any \((a,b,0)\) distribution is given by the following expression: \[ p_k = \bigg(a+\frac{b}{k} \bigg) p_{k-1} \] Which can also being written as: \[ k \frac{p_k}{p_{k-1}} = ak+b \quad for \quad k=1,2,... \] Which is a linear function of the integers \(k\). We then, need to pay attention to the sl...
1188 sym R (2569 sym/45 pcs) 2 img
LAT4082_S2
R Markdown Frequency distributions Binomial distribution size<- 30 prob<- 0.2 N<- seq(0,30, 1) fn <- dbinom(N,size ,prob) plot(N,fn,xlab="n",ylab="f(n)",type="l") # pdf fn2 <- dbinom(N,size ,0.4) lines(N,fn2, col="red", type="l") fn3 <- dbinom(N,size ,0.6) lines(N,fn3, col="blue", type="l") fn4 <- dbinom(N,size ,0.8) lines(N,fn4, col="p...
583 sym R (1334 sym/12 pcs) 4 img
SSP 4
R Markdown ******* FIRST PART ********* setwd("C:/Users/23043/Dropbox/UDLAP/Cursos/2022 Primavera/Pensiones y SS/Datos") library(doBy) ## Warning: package 'doBy' was built under R version 4.1.2 library(ggplot2) library(reshape2) pop<-read.csv("poblacion.csv") Lets explore the variables we have: names(pop) ## [1] "ANIO" "ENTIDAD" "CVE_...
1357 sym R (13376 sym/40 pcs) 21 img
LAT4082_S1
R Markdown Code from LossModels setwd("C:/Users/23043/Dropbox/UDLAP/Cursos/2022 Primavera/Tema Selecto/data") Now, we open the file, the file has many components, but right now we just need few information. For this session we need frequencies for 2010: Insample<-read.csv("insample.csv") Insample2010 <- subset(Insample, Year==2010) claims<-as...
374 sym R (2344 sym/12 pcs) 1 img
LAT4082_S6
R Markdown Spliced distributions We defined the folloeing: \[ X_1 \sim exp(0.5) \quad for \quad [0,1) \] \[ X_2 \sim exp(2) \quad for \quad [1,3) \] \[ X_3 \sim P(2,3) \quad for \quad [3,\infty) \] with \[p_i=\frac{1}{3}\] Before that, we can look at the distributions on each interval. x1<-c(0:1) x2<-c(1:3) x3<-c(3:10) plot(1, type="n", ...
766 sym R (1772 sym/13 pcs) 4 img
LAT4072_S20
Vamos a trabajar en la información de las NIF D-3 Recordemos que se tienen los siguientes puntos que estimar: Beneficios a corto y largo plazo Beneficios por terminación Beneficios post-empleo Generalizando el ejemplo de ayer: Plan de pensión equivalente al 2% del último salario de cotización, por año laborado a partir de los 65 años. E...
2391 sym R (2594 sym/17 pcs)