#The example takes more than 5 seconds because it includes
#several fitting and forecasting process and hence all
#the process is included in donttest
# \donttest{
#In this case, we show the region dataset applying it to a multipopulation model.
#First, we present the dataset
SpainRegions
#An example to how the additive multi-population model fits the data
ages <- c(0, 1, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90)
library(gnm)
multiplicative_Spainmales <- fitLCmulti(model = "multiplicative",
qxt = SpainRegions$qx_male,
periods = c(1991:2020),
ages = c(ages),
nPop = 18,
lxt = SpainRegions$lx_male)
multiplicative_Spainmales
# }
Run the code above in your browser using DataLab