calendarYearEffectAutoregressiveParameter: A generic function to plot and/or return the posterior of the...

Description Arguments Value See Also Examples

Description

A generic function to plot and/or return the posterior of the autoregressive parameter for the calendar year effect for models in BALD. See vignette('BALD').

Arguments

object

The object from which to plot and/or return the autoregressive parameter which is associated with the calendar year effect.

plotDensity

A logical value. If TRUE, the density is plotted. If plotTrace is also TRUE, then two plots are generated. If they are both FALSE, then only the statistics are returned.

plotTrace

A logical value. If TRUE, the trace is plotted. If plotDensity is also TRUE, then two plots are generated. If they are both FALSE, then only the statistics are returned.

Value

Mainly called for the side effect of plotting.

See Also

calendarYearEffectAutoregressiveParameter("AnnualAggLossDevModelOutput") standardDeviationOfCalendarYearEffect calendarYearEffect calendarYearEffectErrors

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
25
26
27
28
29
30
31
32
33
34
35
rm(list=ls())
library(BALD)
data(CumulativeAutoBodilyInjuryTriangle)
CumulativeAutoBodilyInjuryTriangle <- as.matrix(CumulativeAutoBodilyInjuryTriangle)
sample.col <- (dim(CumulativeAutoBodilyInjuryTriangle)[2] - 6:0)
print(decumulate(CumulativeAutoBodilyInjuryTriangle)[1:7, sample.col])
data(HPCE)
HPCE <- as.matrix(HPCE)[,1]
HPCE.rate <- HPCE[-1] / HPCE[-length(HPCE)] - 1
print(HPCE.rate[(-10):0 + length(HPCE.rate)])
HPCE.years <- as.integer(names(HPCE.rate))
max.exp.year <- max(as.integer(dimnames(CumulativeAutoBodilyInjuryTriangle)[[1]]))
years.to.keep <- HPCE.years <=  max.exp.year + 3
HPCE.rate <- HPCE.rate[years.to.keep]
break.model.input.w.ar1 <- makeBreakAnnualInput(
cumulative.payments = CumulativeAutoBodilyInjuryTriangle,
stoch.inflation.weight = 1,
non.stoch.inflation.weight = 0,
stoch.inflation.rate = HPCE.rate,
first.year.in.new.regime = c(1986, 1987),
prior.for.first.year.in.new.regime=c(2,1),
exp.year.type = 'ay',
extra.dev.years = 5,
use.skew.t = TRUE,
bound.for.skewness.parameter=5,
use.ar1.in.calendar.year = TRUE)
## Not run: 
break.model.output.w.ar1 <- runLossDevModel(
break.model.input.w.ar1,
burnIn=30.0E+3,
sampleSize=30.0E+3,
thin=10)
calendarYearEffectAutoregressiveParameter(break.model.output.w.ar1)

## End(Not run)

BALD documentation built on May 2, 2019, 6:51 a.m.