Package: IBMPopSim 1.1.0

IBMPopSim: Individual Based Model Population Simulation

Simulation of the random evolution of heterogeneous populations using stochastic Individual-Based Models (IBMs) <doi:10.48550/arXiv.2303.06183>. The package enables users to simulate population evolution, in which individuals are characterized by their age and some characteristics, and the population is modified by different types of events, including births/arrivals, death/exit events, or changes of characteristics. The frequency at which an event can occur to an individual can depend on their age and characteristics, but also on the characteristics of other individuals (interactions). Such models have a wide range of applications. For instance, IBMs can be used for simulating the evolution of a heterogeneous insurance portfolio with selection or for validating mortality forecasts. This package overcomes the limitations of time-consuming IBMs simulations by implementing new efficient algorithms based on thinning methods, which are compiled using the 'Rcpp' package while providing a user-friendly interface.

Authors:Daphné Giorgi [aut, cre], Sarah Kaakai [aut], Vincent Lemaire [aut]

IBMPopSim_1.1.0.tar.gz
IBMPopSim_1.1.0.zip(r-4.7-x86_64)IBMPopSim_1.1.0.zip(r-4.7-arm64)IBMPopSim_1.1.0.zip(r-4.6-x86_64)IBMPopSim_1.1.0.zip(r-4.6-arm64)IBMPopSim_1.1.0.zip(r-4.5-x86_64)
IBMPopSim_1.1.0.tgz(r-4.6-x86_64)IBMPopSim_1.1.0.tgz(r-4.6-arm64)IBMPopSim_1.1.0.tgz(r-4.5-x86_64)IBMPopSim_1.1.0.tgz(r-4.5-arm64)
IBMPopSim_1.1.0.tar.gz(r-4.7-arm64)IBMPopSim_1.1.0.tar.gz(r-4.7-x86_64)IBMPopSim_1.1.0.tar.gz(r-4.6-arm64)IBMPopSim_1.1.0.tar.gz(r-4.6-x86_64)
IBMPopSim_1.1.0.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
IBMPopSim/json (API)

# Install 'IBMPopSim' in R:
install.packages('IBMPopSim', repos = c('https://daphnegiorgi.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/daphnegiorgi/ibmpopsim/issues

Pkgdown/docs site:https://daphnegiorgi.github.io

Uses libs:
  • c++– GNU Standard C++ Library v3
Datasets:
  • EW_pop_14 - England and Wales (EW) 2014 population, death and birth rates.
  • EW_pop_out - Example of "human population" after 100 years of simulation.
  • EW_popIMD_14 - England and Wales (EW) 2014 population and death rates by Index of Multiple Deprivation (IMD).
  • EWdata_hmd - England and Wale mortality data
  • toy_params - Toy parameters for IBMPopSim-human_popIMD vignette example.

On CRAN:

Conda:

cpp

5.76 score 6 stars 16 scripts 351 downloads 69 exports 38 dependencies

Last updated from:d10b9c642e. Checks:15 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-arm64OK130
linux-devel-x86_64OK146
source / vignettesOK198
linux-release-arm64OK110
linux-release-x86_64OK142
macos-release-arm64OK124
macos-release-x86_64OK204
macos-oldrel-arm64OK125
macos-oldrel-x86_64OK293
windows-devel-arm64OK439
windows-devel-x86_64OK189
windows-release-arm64OK377
windows-release-x86_64OK143
windows-oldrel-x86_64OK111
wasm-releaseOK113

Exports:add_characteristicadd_characteristic.populationage_pyramidage_pyramid.populationage_pyramidsage_pyramids.populationassertCharacteristicsassertEventsassertParametersassertPopulationassertPyramidcapitalizecheck_intensity_codecheck_interaction_codecheck_kernel_codecompatibility_chars_eventscompatibility_pop_modeldeath_tabledetails_cppdetails_intensity_codedetails_interaction_codedetails_kernel_codedetails_type_eventexposure_tableget_characteristicsget_characteristics.populationget_Ctypeget_Rtypegompertzhas_event_typeid_completelinfunmax.stepfunmerge_pop_withidmk_event_individualmk_event_inhomogeneous_poissonmk_event_interactionmk_event_poissonmk_individual_typemk_modelmk_parameters_typesmkcpp_declaration_individualmkcpp_definition_eventsmkcpp_eventmkcpp_initialisation_populationmkcpp_output_populationmkcpp_parametersmkcpp_popsimpiecewise_xpiecewise_xyplot.populationplot.pyramidpopsamplepopsample.pyramidpopsimpopulationpopulation_alivepopulation_alive.populationprint.eventprint.modelprint.populationpyramidstepfunsummary.eventsummary.logssummary.modelsummary.populationsummary.simulation_outputweibull

Dependencies:backportsbitbit64checkmateclicliprcpp11crayondplyrfarvergenericsggplot2gluegtablehmsisobandlabelinglifecyclemagrittrpillarpkgconfigprettyunitsprogressR6RColorBrewerRcppreadrrlangS7scalestibbletidyselecttzdbutf8vctrsviridisLitevroomwithr

Human population
Example description | Population creation | Model parameters | Events creation | Model creation and simulation | Model creation | Simulation of the population over 50 years | Different simulations with the same model | Change of initial population | Modify an intensity | Deactivate an event | Addition of "number of children" characteristic | Addition of "cause of death" characteristics | Model with two independent causes of death | Death and exposure table

Last update: 2024-10-10
Started: 2020-06-22

Human population with swap
Example description | Population creation | Events description | Death events | Parameters | Birth events | Event creation | Swap event | Model creation (without id) | Simulation | Events bounds | Outputs | Initial and final age pyramids with different IMD subgroups | Evolution of population composition by age group | Different simulations with the same model | Simulation without swap events | Simulation of individual life courses

Last update: 2024-10-10
Started: 2020-06-22

IBMPopSim C++ essentials
C++ syntax | Usual numeric functions | Individuals characteristics and model parameters: link between R and C++ | Atomic types (characteristics and parameters) | Vectors and matrices (model parameters) | Predefined functions (model parameters) | Real functions of one variable | Piecewise real functions of two variables | List of functions | Random variables

Last update: 2024-10-10
Started: 2020-06-22

IBMPopSim package description
Brief overview of Individual-Based-Models (IBMs) | Individuals and population | Events type | Intensity classes | Simulation algorithm | Package description | Installation | Population | Events | Intensities | Event kernel code | Model creation | Simulation | Events bounds | Simulation | Outputs | Simulation with swap events | Vector of times in ?popsim. | Individual life courses | References

Last update: 2024-10-10
Started: 2020-06-22

Insurance portfolio
Example description | Population creation | Model parameters | Death intensity | Exit events | Entry events | Events creation | Death events creation | Exit events creation | Entry event creation | Model creation | Simulation | Computation of event intensity bounds | Outputs | Age pyramids | Life tables | Risk class 1 | Global portfolio | Different simulations with the same model

Last update: 2024-10-10
Started: 2020-06-22

Population with genetically variable traits
Example description | Population creation | Events and model creation | Birth event with individual intensity | Parameters | Event creation | Death event with interaction | Model creation | Simulation | Outputs | Simulation with different parameters | Impact of aging velocity | Increase in initial population size | Model with "full" simulation algorithm | References

Last update: 2024-10-10
Started: 2020-06-22

Readme and manuals

Help Manual

Help pageTopics
IBMPopSim: Individual Based Model Population SimulationIBMPopSim-package IBMPopSim
Generic method for add_characteristicadd_characteristic
Add characteristic to a populationadd_characteristic.population
Generic method for age_pyramidage_pyramid
Age pyramid from a population at a given time.age_pyramid.population
Generic method for age_pyramidsage_pyramids
Age pyramid from a population data frame at some given times.age_pyramids.population
Check the intensity code.check_intensity_code
Check the interaction code.check_interaction_code
Check the kernel code.check_kernel_code
Check characteristics-events compatibilitycompatibility_chars_events
Check population-model compatibilitycompatibility_pop_model
Death tabledeath_table
England and Wales (EW) 2014 population, death and birth rates.EW_pop_14
Example of "human population" after 100 years of simulation.EW_pop_out
England and Wales (EW) 2014 population and death rates by Index of Multiple Deprivation (IMD).EW_popIMD_14
England and Wale mortality data (source: Human Mortality Database)EWdata_hmd
Exposure tableexposure_table
Generic method for get_characteristicsget_characteristics
Returns names and C types of the characteristics.get_characteristics.population
Gompertz–Makeham intensity function.gompertz
Linear interpolation function.linfun
Returns the maximum of a function of class 'stepfun'.max.stepfun
A function returning a merged dataframe from a list of population dataframes with id.merge_pop_withid
Creating an event with intensity of class individualmk_event_individual
Creating inhomogeneous Poisson class eventmk_event_inhomogeneous_poisson
Creating an event with intensity of type interactionmk_event_interaction
Creating Poisson class eventmk_event_poisson
Creates a model for IBMPopSim.mk_model
Piecewise real function.piecewise_x
Piecewise real function of two variables.piecewise_xy
Plot the age pyramid of a population data frame (at a given time).plot.population
Plot an age pyramid.plot.pyramid
Generic method for popsamplepopsample
Sample a population from an age pyramid (at a given time).popsample.pyramid
Simulation of a model.popsim
Class populationpopulation
Generic method for population_alivepopulation_alive
Returns a population of individuals alive.population_alive.population
Print Eventprint.event
Printing of a modelprint.model
Printing populationprint.population
Class pyramidpyramid
Step Function.stepfun
Summarizing an eventsummary.event
Summary logssummary.logs
Summary of a modelsummary.model
Summary populationsummary.population
Summary simulation outputsummary.simulation_output
Toy parameters for IBMPopSim-human_popIMD vignette example.toy_params
Weibull function.weibull