Skip to content
Snippets Groups Projects
Commit ad177af0 authored by Reinhold Kainhofer's avatar Reinhold Kainhofer
Browse files

Add function to merge two matrices/data.frames, where one goes from time 0 to...

Add function to merge two matrices/data.frames, where one goes from time 0 to t-1, and the other from time t to the end in the resulting matrix/data.frame.

This is used later on when contract changes are done, because everything up to t-1 is from the old values, everything start at t is using the new contract data.
parent 844a91f9
No related branches found
No related tags found
No related merge requests found
library(abind);
mergeValues = function(starting, ending, t) {
rbind(starting[1:t,], ending[-1:-t,])
}
mergeValues3D = function(starting, ending, t) {
abind(starting[1:t,,], ending[-1:-t,,], along=1)
}
# Caution: px is not neccessarily 1-qx, because we might also have dread diseases so that px=1-qx-ix! However, the ix is not used for the survival present value
calculatePVSurvival = function(px=1-qx, qx=1-px, advance, arrears=c(0), ..., m=1, mCorrection = list(alpha=1, beta=0), v=1) {
# assuming advance and arrears have the same dimensions...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment