Comments (8)
Residuals
The way the above paper and you calculate the residuals is different to the rstandard
method in R, which is used by residual.MackChainLadder. See for example the following entries on Stackoverflow here and here.
The following R statement will give you the proportional factor difference between your calculated residuals and the standardised R output (Std R Resdiuals/ Std Data Residuals):
RAAmacksa <- MackChainLadder(RAA, alpha = 0, est.sigma="Mack")
lapply(RAAmacksa[["Models"]], function(model) sqrt(1-lm.influence(model, do.coef = FALSE)$hat))
sigma
The missing sigma value is calculated using the formula in Mack's 1999 paper on page 363. Entering the formula into your spreadsheet =SQRT(MIN(I44^4/H44^2,MIN(I44^2,H44^2)))
produces the value your getting from R.
from chainladder.
Please provide a minimal reproducible example in R.
from chainladder.
My R code could be found below... I have attached the R console output in an excel file.
R Std. Residuals.xlsx
#Plotting RAA data
plot(RAAtri)
#ATA of RAA
coef(chainladder(RAAtri))
###########1:Mack method using straight average age-to-age factors##########
RAAmacksa <- MackChainLadder(RAAtri,alpha = 0, est.sigma="Mack")
# ATA of MACK method
RAAmacksa$f
# (S.D)Standard errors of the chain-ladder age-to-age factors
RAAmacksa$f.se
# (S.E)Standard errors of the true chain-ladder age-to-age factors
RAAmacksa$F.se
# Standard Deviation
RAAmacksa$sigma
#simple average ATA FULL Mack triangle
RAAmacksa$FullTriangle
ChainLadder:::residuals.MackChainLadder(chainladder(RAAtri))
# simpla average residual of mack
resid(RAAmacksa)
plot(RAAmacksa)
from chainladder.
Please try to be more helpful by providing detailed code with comments. An Excel file is not that helpful. Please replicate your Excel calculations in R. Be specific about where you the think the current code is incorrect, e.g. point to the relevant lines in the R code hosted on GitHub.
from chainladder.
These are the codes to be very precise. I replicated R calculations in excel which I have already attached.
RAAmacksa <- MackChainLadder(RAAtri,alpha = 0, est.sigma="Mack")
resid(RAAmacksa)
standard.residuals which you get as part of the output does not look correct.
Another issue:
RAAmacksa$F.se and RAAmacksa$sigma seems to be picking "0.008580526" as standard deviation for the link development ratio of 1.009.
RAAmacksa$sigma
[1] 12.340461705 0.474090850 0.317091093 0.066795689 0.074660819 0.050245830
[7] **0.008580526** 0.021344747 **0.008580526**
I could not locate the exact codes in GitHub but they start from line 580 and ends at 610.
from chainladder.
For cross checking all that needs to be done is run the RAA data with mack chain ladder code using alpha = 0.
The standardized residuals of the all year's simple average of the link development ratio can be cross checked with page number 10 of the paper....
"Flexible Factor Chain Ladder Model: A Stochastic Framework for Reasonable Link Ratio Selections" by Emanuel Bardis and Ali Majidi; and Daniel Murphy.
Like I mentioned earlier the RAAmacksa$F.se and RAAmacksa$sigma provides standard deviation of 0.008580526 for the link development factor of 1.009. which must not be there in my view.
from chainladder.
About the sigma.... I am assuming thar Mr.Thomas Mack would have wanted it to be like that for some purpose.... however in the normal chain ladder we would not expect a standard deviation...am I correct?
Residuals
Is it possible to use what Mr.Murphy has suggested unlike what R is picking up by default? Could that option be provided for the users? My understanding is that results of both the methods are not completely off from each other.
from chainladder.
I'd rather have the package consistent with the original paper and R's approach of calculating standardised residuals. However, feel free to fork the repository and change the code to your own requirements.
from chainladder.
Related Issues (20)
- MultiChainLadder plot error when NA's in triangle HOT 1
- Triangle with empty values in early development periods HOT 27
- glmReserve: Missing row in summary HOT 5
- dev.period order not correct when using plot(triang, lattice=TRUE) HOT 2
- Bootchainladder Gamma process variance incorrect parametrization
- tweedieReserve : var.power=NULL not working HOT 2
- tweedieReserve : Error in summary.tweedie when rereserving = FALSE
- package car is missing HOT 5
- dfCorTest and cyEffTest fail for mxn triangle HOT 1
- actuar HOT 5
- Probable bug in `glmReserve()` source code HOT 1
- I want to change presaved claims (from ChainLadder-package) HOT 2
- Is it possible to summarize P/I ratio values according to Mack?
- MackChainLadder: `tail = FALSE` works fine, `tail = TRUE` errors. HOT 2
- Cross Reference R/Python in README? HOT 4
- Theoretical Understanding of How Methods Should Handle 0's HOT 5
- Mean IBNR & Quantiles Not Comparable, MackChainLadder HOT 3
- Problems Loading on MacBook Pro OS 10.13 HOT 1
- class triangle object
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chainladder.