0

I'm trying to do a bootstrapping process with a Renshaw and Haberman model fit with STMoMo package. Here is the code :

RHboot<- bootstrap(RHfit, nBoot = 2000, type = "semiparametric")
plot(RHboot,nCol = 3,parametricbx=FALSE) 
RHSimPU <- simulate(RHboot, h = forecastTime)
RHSim <- simulate(RHfit, nsim = 2000, h = forecastTime)
print(RHSimPU)

After run the the simulation row code I didn't get any error message but after apply "print" function I got the following output:

Simulations of Stochastic Mortality Model

Call: simulate.bootStMoMo(object = CBDMaleboot, h = forecastTime)

Simulation based on
Call: bootstrap.fitStMoMo(object = RHfitMale, nBoot = 2000, type = "semiparametric")

kt model: mrwdError in if (order[7] > 1 & sum(order[4:6]) > 0) result <- paste(result,  : 
  argument is of length zero  

which didn't let me then create the confidence intervals. The strangest thing is that the same code works perfectly for the model of Lee and Carter. See output attached.enter image description here

The code only works with LC model, the only one with one time-varying parameter. It seems to be related to ARIMA order according to the Forecast package code robjhyndman/forecast

Could you help me, please? Thanks in advance.

StupidWolf
  • 45,075
  • 17
  • 40
  • 72
Lara RB
  • 1
  • 2

1 Answers1

0

Issue solved: in RH fitting model code I have changed the weight condition to wxt=1 (default option) instead of wxt =wxt, where:

wxtMale <- genWeightMat(ages = ages.fit , years = years.fit, clip = 3).

However I continue without noticing why it worked in the LC model since I was using the same condition. The same message still appears but now I can create the confidence intervals. Thanks

Lara RB
  • 1
  • 2