Changes in Version 0.4.0 o IFRS 17 and Solvency II. New discount_reserves(): the chain ladder's future payments by calendar period, discounted with a yield curve (one rate, or spot rates by term). New risk_adjustment(): IFRS 17's risk adjustment, or Solvency II's risk margin, as a percentile of the bootstrapped reserves or as the cost of the capital held over their run-off, with the confidence level IFRS 17 asks to disclose. New sii_premium_reserve_risk(): the standard formula's capital for non-life premium and reserve risk, with the parameters of Delegated Regulation (EU) 2015/35 as amended in 2019 (sii_nonlife_segments, sii_nonlife_correlation), the adjustment for non-proportional reinsurance and geographical diversification. The reserving tool has an IFRS 17 & SII tab, in its report too, and the portfolio tool a Standard formula tab for every segment. o New compare_reinsurance(): the same simulated claims put through several reinsurance programmes (a quota share, an excess of loss layer, a stop loss, or a mix), with each one's expected recoveries, premium, margin, net result, capital and capital relief, and its value at a cost of capital. The reinsurance pricing tool compares up to five programmes on a new Programmes tab. o compare_reinsurance() also takes a surplus treaty: of each risk it cedes the part of the sum insured above the retention, up to a number of lines, and that share of the risk's premium and claims. Each simulated claim falls on a risk of the profile given (a sum insured per risk or band, weighted by premium). The reinsurance pricing tool's programmes include one, on the Exposure tab's risk profile. o Rate reviews. New on_level_premium(), the parallelogram method worked out exactly for any rate changes and policy term; indicated_rate_change(), the loss ratio method with trend, expenses, profit and credibility; and buhlmann_straub(), credibility between schemes, fleets or segments, which matches the actuar package. New vignette "Rate reviews: on-level premiums, the indicated rate change and credibility". o The GLM fitting tool writes a report of the model: the data and choices, the coefficients, the rate table with a chart per rating factor, and the validation on the rows held out. o Example data in the tools: new data sets motor_policies (10,000 simulated policies) and liability_claims (claims at their policy limits). The GLM tool's Try an example button imports the policies with a Poisson model set up, and the distribution fitting tool's fits the claims with their limits. o Excel files: every tool reads .xlsx and .xls uploads (with readxl, now suggested), and the reserving, GLM, reinsurance pricing and portfolio tools download their results as an Excel workbook (with writexl, now suggested). o The distribution fitting tool's Severity tab has a P-P plot beside the Q-Q plot (with policy limits, against the Kaplan-Meier estimate), and a Tail (CTE) tab with the conditional tail expectation (TVaR) at 90%, 95%, 99% and 99.5% of the claims and of each fitted distribution. o The six tools are named alike: NetSimulator (the claims simulator, until now NetSimR Simulator), NetDisFit, NetGLM (the GLM fitting tool), NetReserve, NetTreaty and NetCapital, in each tool's header, browser tab, welcome page and report, and on the website. o The website has a gallery of the tools, on the Try online page, and a page on custom tools for insurers and reinsurers; each tool's About card links to it. A worked example runs each of the six tools on the package's example data and opens the report it writes; the reports are written again by the tools each time the website is built. o Zero-inflated claim counts: simulate_claims(), simulate_function() and the claims simulator take a Zero_Inflated_Poisson and a Zero_Inflated_Negative_Binomial, with the probability of an extra zero (more periods without a claim than the Poisson or Negative Binomial gives). The distribution fitting tool fits both, suggests the frequency with the lowest AIC, and sends a zero-inflated fit to the simulator. o Heavier tails: simulate_claims(), simulate_function() and the claims simulator take a Weibull, a Burr (type XII) and a Generalised Pareto severity. The distribution fitting tool fits the Burr and the generalised Pareto too (with a reporting threshold and policy limits as well), sends them to the simulator, and draws a Hill plot of the tail index with its estimates from the largest claims. o The distribution fitting tool writes a report of every analysis run (its figures, tables of fits and charts, in both themes), and saves and loads its settings: the data options, each tab's columns and options, the slicing points and thresholds, and the models chosen to export. The reinsurance pricing tool writes a report of the layer's pricing, its experience and exposure ratings and, once compared, the programmes. o From the fit to the reinsurance: the reinsurance pricing tool's Programmes tab loads a model fitted in the distribution fitting tool (the settings file of its Export tab, or one of the claims simulator), and compares the programmes on it. Its gross portfolio takes every claim count and claim size the fitting tool exports: the zero-inflated counts, the Weibull, the Burr, the generalised Pareto and the Normal beside those it had, and the Pareto slices of a sliced or piecewise Pareto model. compare_reinsurance() has new pareto_thresholds and pareto_alphas arguments for those slices, as simulate_claims() has. Choosing a distribution on the tab now sets its parameters to defaults of a like mean. o The vignette "Simulating claims with simulate_claims()" has sections on the zero-inflated claim counts and on the Weibull, Burr and generalised Pareto claim sizes. o Phones: the reserving, GLM, reinsurance pricing, portfolio and distribution fitting tools scroll to the results after a run; the claims simulator has a second Run button at the foot of its settings; small text and buttons are larger; the distribution fitting tool's tables of fits show each fit as a card, and its messages show at the top of the screen; and the reinsurance pricing tool shows a card per programme in place of the grid. o Faster: compare_reinsurance() sums each simulated year's claims in one pass, and the distribution fitting tool's fits above a reporting threshold or with policy limits work from sufficient statistics of the claims. The tools read a data file faster: they check its encoding and find its header from its first lines, not the whole file, and a file too large for the memory says so, not that its separator may be wrong. o The reserving and reinsurance pricing reports list the parts they leave out with the reason, such as the Munich chain ladder without incurred claims, where before a part the tool could not work out was left out without a word. o The charts of the six tools and their reports are drawn in the page, where they were pictures drawn by R. The pointer shows the values under it, such as the gross, ceded and net losses at a return period, each origin's claims at a development period, a link ratio and its origin, or the simulations in a bar of a histogram. An entry of the legend under the pointer highlights its lines, bars or markers, and a click (or Enter) hides or shows them. Dragging across the plot zooms into that part (across: the x axis, up or down: the y axis), with axes to suit, and a double click or the Reset zoom button zooms out. The charts follow the page's width and its light or dark theme at once, and the reports print them in the light one. The claims simulator's Compare tab shows the losses of every run at the return period under the pointer. o Charts of claims, frequencies and severities start their axis at zero, so a difference between bands is not exaggerated: the GLM tool's actual and predicted, lift and double lift charts started near their lowest band when the exposure was drawn on the right, and so did the distribution fitting tool's Q-Q plot on a linear scale. Ratios (link ratios, development factors) keep an axis around their values, and the reserving tool's chart of link ratios keeps outliers (beyond three interquartile ranges of the quartiles) at the edge of its axis, so a ratio of 40 among ratios under 3 no longer flattens the others. Axes of shares show percentages. o The reports fill the window, where they kept to a column in the middle, and are a fraction of their size; their contents stay in view as the page scrolls, in the claims simulator's Report tab too. NetSimR no longer imports base64enc, which embedded the reports' charts as images. o Amounts are written in whole units in the tools and their reports, unless they are small: the claims simulator's summary statistics and percentiles, and the distribution fitting tool's claim sizes, fitted means, conditional tail expectations, thresholds and parameters in the units of the claims, which were rounded to four significant digits (12,350 for 12,345.67). A column of a table is written with the decimals of its largest amounts. o The download buttons of the tools on the website work in Chrome and Edge, where they failed with "File wasn't available on site": Chrome asked the website for the files, which only the R in the page makes. o Each data upload of the tools says where its file is read: by the R running in the page, on the visitor's computer, in the browser tools of the website, and by the R session of the tool otherwise; it is sent nowhere else. The website says so on its home page and on the Try online page, with what the pages do fetch and how this was checked. o A logo: NetSimR's symbol in a hexagon (man/figures/logo.png), shown in the README and on the website, which also has the symbol as its browser icon and a picture for links shared on LinkedIn and elsewhere. o The tools ask no other server for anything: their fonts, Inter and JetBrains Mono, now come with the package (inst/fonts, under the SIL Open Font License) where they were requested from Google Fonts. Run from R, a tool needs no internet connection and makes no request outside the computer. o The tools' tables fit their cards on more screens: a column heading of several words takes two lines, and a row's name wraps, before the table scrolls sideways. The reinsurance pricing tool's comparison of programmes showed its last column, the value of each programme, only after scrolling. o Bug fixes: discount_reserves() stops with a clear message when tail_periods is not a whole number (such as Inf), and indicated_rate_change() when the years are not numbers; large amounts in the tools' tables and messages no longer show as 1e+05; the claims simulator's introduction no longer speaks of panels on the left and right, which a phone shows one above the other. o New run_shiny_portfolio_tool(), NetCapital: the capital of a portfolio of lines of business, each simulated from a claim count and a claim size distribution or uploaded as simulated losses (such as the claims simulator's), joined by a Gaussian or t copula with one correlation or a matrix. It gives each line's and the total's VaR and TVaR, the diversification benefit and each line's capital (co-TVaR), with charts of the capital, the total losses and the dependence of two lines, downloads, a settings file and an HTML report. o GLM fitting tool: a new Rates tab gives the fitted model as a base rate and a table of relativities for each rating factor, worked out from the effect of each term, so splines, polynomials, bands and interactions are covered: the base rate times a policy's relativities (and its exposure) is its prediction. The table downloads as a CSV for a rating engine, and a new file of policies can be scored with the model. Formulas can use natural and B-splines, ns() and bs(), and bands, cut() with c() for the breaks (the splines package, part of R, is now imported). o Reserving tool: a report of the triangle, the development factors and the tail, the ultimates of each method, Mack's and the one-year standard errors, the More methods tab, the Munich chain ladder and the bootstrap, with their charts, as one HTML file. The Tail curve tab compares the tail factors of the exponential and inverse power curves and of Clark's growth curves, with the IBNR each gives. chain_ladder() gains tail_periods, the periods a tail curve is extrapolated over (100 as before), set in the tool. o Distribution fitting tool: claims paid at their policy limit, one limit for all or a column of limits, are fitted as censored (the loss was at least the limit), so the fitted tail is not cut short; with a reporting threshold too. The fits match those of the survival package's survreg(), and the K-S distance and the charts use the Kaplan-Meier estimate. o Each tool's About card shows the version and links to the website, the tools online, the GitHub repository and its issue forms (to report a problem or suggest a feature, with the tool and the version filled in), with how to cite the package; citation("NetSimR") gives the same reference (new inst/CITATION), with the DOI that CRAN gives the package, doi:10.32614/CRAN.package.NetSimR. The card also names NetSim Analytics, the company behind NetSimR, with its website, email address and LinkedIn page. The reports link to the website in their footer. o A new title, "Non-Life Actuarial Pricing, Reserving, Reinsurance and Capital", and a description that leads with what the package is for. o Claims reserving. New chain_ladder(): the chain ladder with Mack's standard errors (process and parameter, by origin and in total), with volume-weighted, simple or regression averages, the latest calendar periods only, link ratios left out, and a tail factor entered or fitted (exponential or inverse power curve); its results match the ChainLadder package's MackChainLadder(). New bornhuetter_ferguson() (Benktander with iterations = 2), cape_cod() (with Gluck's decay) and bootstrap_chain_ladder(), England and Verrall's over-dispersed Poisson bootstrap of the reserves with a gamma or over-dispersed Poisson process. New as_triangle() builds a triangle from a table of claims, long (payments are added up) or wide. New data sets raa_triangle, taylor_ashe_triangle and simulated_motor_claims. o New merz_wuthrich(): the one-year view of the reserves, the standard error of the next year's claims development result (Merz and Wuthrich), matching the ChainLadder package's CDR(). New munich_chain_ladder(): paid and incurred claims projected together (Quarg and Mack), matching MunichChainLadder(). New data sets quarg_mack_paid and quarg_mack_incurred; simulated_motor_claims gains an incurred column. o New vignette "Claims reserving with the chain ladder and its relatives". o Excess of loss pricing. New burning_cost(): the past large losses indexed to the rating year, put through the layer as if it had been in force, developed to ultimate, with annual aggregate terms, over the on-level premium of their year; it warns when an indexed reporting threshold is above the deductible. New pareto_rating(): a Pareto fitted to the indexed large losses gives the frequency and the expected loss to the layer, also for layers above the largest loss seen. New property_exposure_rating() and casualty_exposure_rating(): a risk profile's expected losses shared with the layer by an MBBEFD exposure curve or a claim size distribution's limited expected value. New mbbefd_curve(), swiss_re_curve() and swiss_re_parameters(): Bernegger's exposure curves, Swiss Re's Y1 to Y4 and the Lloyd's curve, checked against the mbbefd package. New technical_premium(), with the loading and the expected reinstatement premium, rate on line and payback, and credibility_weight(). New data sets xl_large_losses, xl_premium, xl_property_profile and xl_casualty_profile, and a vignette, "Pricing an excess of loss layer". o New reinsurance pricing tool, run_shiny_reinsurance_pricing_tool(): the layer and rating year; the burning cost and Pareto rating of an example or uploaded large loss list, with each year's premium, rate index, development and inclusion; the exposure rating of a property or casualty risk profile; the blend with a credibility weight; the technical premium; downloads and saved settings. o The five tools run in the browser on the package's website, with webR and shinylive, with nothing to install (https://netsimr.netsimanalytics.com/articles/try-online.html). There, the simulator has no processing choice and the GLM tool reads CSV files only, as a browser cannot start worker processes or reach a database. o New reserving tool, run_shiny_reserving_tool(): load an example or a file of paid or incurred claims, choose the development factors (click a link ratio to leave it out) and the tail, compare the chain ladder, Bornhuetter-Ferguson, Benktander and Cape Cod ultimates and loss ratios with each origin's premium, a priori loss ratio and method, and measure the uncertainty with Mack's standard errors and the bootstrap, with downloads of the results, the projected triangle and the simulations. A Paid & incurred tab gives the Munich chain ladder, the Uncertainty tab the one-year view, and the Data tab saves and loads the session's settings (the link ratios left out and each origin's choices included). o The deductible arguments of simulate_function() are now spelled reinsurance_structure_eel_deductible_amount and reinsurance_structure_al_deductible_amount. The misspelled names (dedctible) still work, with a deprecation warning, and simulator settings files saved with them still load. o Every CamelCase function has a snake_case name too, the same function: pareto_capped_mean() for ParetoCappedMean(), ilf_gamma() for ILFGamma(), psliced_lnorm_pareto() for pSlicedLNormPareto(), upper_incomplete_gamma() for IGamma(), and so on. The CamelCase names keep working. o A package website, built with pkgdown, at https://netsimr.netsimanalytics.com/, and the share of the code the tests run measured on every push (covr and Codecov). o Fewer dependencies. Parallel simulations run on base R's parallel package instead of future, which is no longer needed (with the globals, listenv and parallelly packages it brought). simulate_function() and simulate_claims() take a new workers argument: NULL (the default) for one worker per available core, a number of workers, or a cluster from parallel::makeCluster() to reuse across calls; a future plan set with future::plan() is no longer used. Seeded results are unchanged, and the simulator app still keeps its workers running between runs. o NetSimR now needs R 4.1.0 or later, as the packages that shiny depends on do. o Parallel runs can choose themselves: multiprocessing = "auto" in simulate_function() (parallel = "auto" in simulate_claims()) runs the chunks on workers only when that is expected to be at least a quarter faster, and chooses how many to start. It times the run's second chunk in the session (a run of two chunks is judged from the expected number of claims and simulations), and weighs the rest against the chunks, the cores and whether the workers are already running; the results are the same however the chunks run. The claims simulator's Multiprocessing switch is now a Processing choice of Auto (the default), Single and Parallel: Auto starts the workers on the first run they make faster and keeps them, and the report says how many workers a run used. Settings files with the old switch load, on as Parallel and off as Auto. o Parallel runs are faster to send to the workers: their socket connections no longer wait to bundle small packets (Nagle's algorithm), which held each run up by 0.3 to 1.5 seconds on Windows, and the workers load the package when they start rather than in the first run. The CappedMean and PureIBNR vignettes fit their censored and truncated models with a few lines of optim() instead of the crch package, which is no longer suggested. o Claims simulator: finding each simulation's largest claim, for the occurrence exceedance probability, is faster (about 4 times with ten claims per simulation), the report of a large run builds in half the time (each result is sorted once, and the claim counts are tabulated), and the message listing the settings to fix before a run follows the fields as they are filled in. o New simulate_portfolio(): several lines of business, each simulated with simulate_claims() or given as simulated losses, joined by a Gaussian or t copula (each line's losses reordered by the copula's ranks, so each keeps its distribution), with the VaR and TVaR of each line and of the total, the diversification benefit, and each line's capital by co-TVaR (the Euler allocation, which adds up to the total's TVaR). o More reserving methods. actual_vs_expected() checks the chain ladder against the latest calendar period: the chain ladder of the triangle without its latest diagonal predicts each origin's development, compared with what was reported, with Mack's standard error and a standardised difference. clark_growth() fits Clark's (2003) log-logistic or Weibull growth curve by over-dispersed Poisson maximum likelihood, by the LDF or the Cape Cod method, with process and parameter standard errors and an optional truncation; its results agree with the ChainLadder package's. inflation_adjusted_chain_ladder() restates past payments in today's money, develops them, and inflates the future payments at the expected rate. The reserving tool shows all three on a new More methods tab. o Distribution fitting tool: the Severity tab fits a Weibull distribution too (from zero, and above a reporting threshold), gives each fit's Anderson-Darling statistic, which weighs the tails more than the Kolmogorov-Smirnov distance, and draws a Q-Q plot of each fit's quantiles against the claims'. o New tweedie_family(): a Tweedie family for glm(), a compound Poisson-Gamma model of the loss cost (zero for most policies) with variance phi * mu^p for a power between 1 and 2. It is quasi-likelihood, with no AIC; its fits match the statmod package's. The GLM fitting tool offers it, with the variance power, and compares Tweedie models by their deviance on the rows held out. o GLM fitting tool: validation and variable selection. The Model tab can hold out 10%, 20% or 30% of the rows for testing (with a seed): the model is fitted to the others, and every row is predicted. A new Validation tab gives the deviance per row and the Gini coefficient of the training and the test rows, a lift chart, the Lorenz curve, and a double lift chart against a stored model. A Variable selection card suggests terms by stepwise AIC or BIC from the fitted model, adding candidate columns or dropping terms, with each step's deviance on the rows held out, or by a penalised fit (the lasso, the elastic net or ridge regression, with the glmnet package, now suggested), its penalty chosen by cross-validation and each choice's deviance on the rows held out; it puts the terms in the formula, to fit as an ordinary GLM. The actual vs predicted chart can show the training or the test rows alone, the predictions download marks each row's sample, and the settings file keeps the rows held out, the seed and the criterion. o GLM fitting tool: PostgreSQL databases are read with RPostgres, the current DBI driver, instead of the older RPostgreSQL; 64-bit integer columns come back as numbers. o New reinstatement_premium(): the reinstatement premium of each simulation, from the reinstatements used, the upfront premium and the rate of each reinstatement, pro rata as to amount. simulate_claims() takes eel_premium and eel_reinstatement_rates (simulate_function() reinsurance_structure_eel_premium and reinsurance_structure_eel_reinstatement_rates) and returns a reinstatement_premium column. In the claims simulator, a limited EEL layer with reinstatements takes an optional upfront premium and a reinstatement rate; the summary and the report give the rate on line and the expected reinstatement premium, total premium and loss ratio. o Claims simulator: the report gives the occurrence exceedance probability (OEP), the largest single claim of each simulation, next to the aggregate (AEP): the return period chart draws both and the tail table has a column for it. simulate_claims() and simulate_function() take largest_claims = TRUE to return each simulation's largest claim. The app asks for it unless a run would draw more than 20 million claims, where it would slow the run down. o Distribution fitting tool: the Severity tab takes an optional reporting threshold. For claims reported only above it, each distribution is fitted by maximum likelihood to the claims above the threshold as claims from zero (left truncation): the parameters are of all claims, and the means, K-S distances and charts of the claims above the threshold. A fit that runs to the edge of its parameters, as a Normal or a Gamma does for claims with a heavier tail, is shown as failed and explained under the table. o Distribution fitting tool: a new Export tab saves fitted models as a settings file of the claims simulator, which its Load settings button loads: the Poisson or Negative Binomial of the Frequency tab, and a severity of the Severity tab, a sliced LogNormal - Pareto (- Pareto), or a piecewise Pareto as a Pareto with the simulator's Pareto slices. With a severity fitted above a reporting threshold, the counts of the claims above it are scaled up to all claims. o GLM fitting tool: a "Rating factors (CSV)" download gives each variable's levels with their coefficient, standard error and, for a log link, their relativity to the base level and its 95% interval. o Claims simulator: loading a settings file without a severity (such as a frequency saved by the distribution fitting tool) no longer switches off the Normal's truncation at zero. o The three apps: an off switch's knob and the sliders' handle, track and value are now clearly visible in the dark and the light theme. The sliders' handle was drawn in the card's colour, so it could not be seen. o Claims simulator: the number of simulations, the Normal severity's mean and standard deviation, the Pareto's x_m, the fixed claim amount, the Pareto slices' thresholds, the severity cap, and the limits and deductibles of the EEL and aggregate layers show thousands separators (1,000,000) once a value is entered or Enter is pressed. They can be typed without separators, or with commas or spaces grouping the digits in threes; a comma that does not, such as a decimal comma in 2,50, leaves the field without a number rather than being read as 250. A browser's number input cannot show separators, so these are text inputs that send the server the number, as before: NA when a field is empty or does not hold a number. o Claims simulator: the Pareto severity asks for x_m (the minimum) before alpha, each Pareto slice for its threshold before its alpha, and each reinsurance layer for its limit before its deductible, the order in which actuaries enter them. The report and the Compare tab follow the same order: the Pareto's x_m before alpha, each slice's threshold before its alpha, and each layer's limit before its deductible. Only the order shown changes: the input ids, the settings files, and the Pareto's parameters passed as c(alpha, x_m) to simulate_function() and simulate_claims() stay as they were. Changes in Version 0.3.3 o run_shiny_simulator() and run_shiny_distribution_fitting_tool() stopped with "File to import not found or unreadable: ...\bslib\lib\bs5\scss\ _functions.scss" when the package was installed from a binary built on another machine, such as a CRAN binary on Windows or macOS. The two tools built their pages when the package was installed, and the pages' bslib theme kept absolute paths to Bootstrap's SCSS files on the machine that built it (D:\RCompile\CRANpkg\lib\... for CRAN's Windows binaries). The pages are now built each time a tool starts, from the bslib installed where it runs, as the GLM fitting tool's page already was. Nothing else about the tools changes. Changes in Version 0.3.2 o The test of the settings files asked for a double to come back from its text form bit for bit. A platform built without long double reads such text up to a bit out, whatever the number of digits written, so the test failed on CRAN's noLD check; it now allows that difference where the platform cannot do better and still asks for an exact value everywhere else. Settings files themselves are unchanged. Changes in Version 0.3.1 o Results change in four cases, each described below: an each-and-every-loss layer with limited reinstatements combined with an aggregate deductible; totals, gross claims and reinstatements used, which are no longer rounded to two decimals; the ratios of PureIBNRGamma() and PureIBNRLNorm(); and the quantiles, capped means and exposure curves in the three items that follow. The Shiny tools also no longer load settings files saved as .rds. o qSlicedGammaPareto() and qSlicedLNormPareto() give NaN for a probability outside [0, 1], as qgamma() does. Where the reciprocal of the Pareto shape is a whole number (a shape of 1, 0.5 or a third), a probability above 1 gave a plausible-looking quantile instead: q = 1.1 gave -7357.59 with a shape of 1, and 54134.1 with a shape of 0.5. o SlicedGammaParetoCappedMean() and SlicedLNormParetoCappedMean() give Inf at an infinite cap when the Pareto shape is 1 or below, agreeing with SlicedGammaParetoMean() and SlicedLNormParetoMean(). They gave NaN when the weight of the tail underflowed to zero. o ExposureCurveLNorm() gives 1 at an infinite cap, where it gave NaN when the mean of the distribution overflowed (a sigma of 40, say). o ExposureCurveGamma() and ExposureCurveLNorm() name themselves when arguments of different lengths cannot be recycled, as the other functions do; they named the capped mean they call. o simulate_claims() rejects a progress argument that is not a function, which it used to ignore. o Settings files keep the exact value of every number. They were written with 15 significant digits, so a value such as a third came back slightly different and a seeded run loaded from its own settings file could give different results. Values that need no more digits are still written plainly (0.3 stays 0.3). o A settings file with a setting given twice, a blank line between the settings, no version line, or a value built to be enormous is refused with a message saying what is wrong. A repeated setting used to load two values into a field that holds one, and a missing version line reported "subscript out of bounds". o Claims simulator: a slice added while settings or an example are loading no longer makes the next "Add slice" jump by the slices that were pending. o Claims simulator: the report's histogram of claim totals keeps simulations whose total is negative. It left them out while its note said that only the simulations totalling zero were left out. o Claims simulator: the report's headline figures, layer metrics and gross/ceded/net table round the modelled series on its own scale, so they agree with the statistics table on the same page and with the Compare tab. A layer with a mean of 1.90 and a median of 0.00 was shown as 2 and 0. o Claims simulator: distribution parameters far below one are shown to three significant figures (an Exponential rate of 1e-5, a mean claim of 100,000, was shown as 0), and a seed of 100000 is shown as 100,000, not 1e+05. o Claims simulator: the report fits a phone-width window; below about 352 px the right edge of every section was cut off. Its charts are drawn with the cairo device on Windows, as the charts in the app already were. o Claims simulator: the Compare tab tells apart two runs that differ only by "Truncate at zero", and leaves out of the chart a run with too few simulations to draw a curve, which appeared in the legend with no curve. Return-period charts label their vertical axis Ceded or Net when that is what they show, as the other charts do. o Claims simulator: the frequency and severity choices and the Compare tab's run name are announced by screen readers. o Claims simulator: with multiprocessing on, an ordinary error during a run (an invalid parameter, an overflowing distribution) no longer shuts the parallel workers down, so the next run reuses them instead of starting new ones. The workers are restarted only when one of them breaks, and then no connection to a replaced worker is left open to be closed later with a "closing unused connection" warning. o GLM fitting tool: a formula may use the data's columns, the formula operators and I(), log(), exp(), sqrt(), pmin(), pmax(), poly(), factor(), as.factor(), interaction() and offset(); anything else is refused by name. The formula was run as R code, so a settings file from someone else could carry code that ran on the next click of Fit model. o GLM fitting tool: after data is imported, the model tiles, the chart and the downloads say which file the model on screen was fitted to, and the downloads wait until it is fitted again; a download asked for anyway (from a page left open across the import, or a kept link) is refused rather than served. The tiles, the coefficients and the downloaded predictions used to come from the previous import with nothing saying so. o GLM fitting tool: two stored models are compared by AIC only when they were fitted to the same import and left out the same rows; models of unrelated data with the same number of rows were marked "lower". o GLM fitting tool: warnings raised before a binomial response with more than two values are kept rather than replaced; the predictions CSV calls its column model_prediction when the data already has one called prediction; and the number of bands read from a settings file is held to the range of the slider. o GLM fitting tool: a model is fitted as the screen shows it even when Fit model is clicked straight after loading a stored model or a settings file, or after a change of family, before the browser has reported the new values. The fit mixed the loaded family and link with the response, offset, weights and formula shown before the load, so a stored binomial model could be fitted to the previous count response and fail. A settings file whose link does not suit its family uses the family's default link and says so, instead of leaving the link blank on screen. o GLM fitting tool: MySQL is no longer offered as a data source, and RMySQL is no longer suggested; RMySQL is deprecated by its authors. A settings file that chose MySQL loads without it, and the database type is left as it is. The database user no longer defaults to MySQL's "root". o Distribution fitting tool: a file that is not valid UTF-8 is read as Windows-1252, which is what Excel writes on a German or French Windows. An accented character used to end the session with a grey overlay as soon as the file was uploaded. o Distribution fitting tool: a row with more fields than the rows above it keeps them in their own columns. The surplus value started a new row instead, so claims that were never in the file were fitted (a file of eight claims gave eleven). o Distribution fitting tool: the slicing point and piecewise Pareto threshold sliders span the claims up to the largest once the top half a percent are left out, so the body of a heavy-tailed distribution can be reached; one large claim used to leave the body in less than a pixel of the bar. A point can also be typed in the box beside its slider, and the sliders grow to hold a value beyond their range. o Distribution fitting tool: the header is found after more than 100 blank lines; the frequency histogram shows the probability a model puts below the smallest count, which zero-truncated data left off the chart; the Pareto alpha between two slicing points needs at least three claims between them and reports a fit that did not converge, instead of showing whatever the optimiser stopped at; and the Data tile asks whether the first row is a header when the column names are all numbers. o The help pages say what each function does rather than repeating its title, the sliced distribution pages say which argument is the Pareto shape, and the three applications link to each other. o The vignettes no longer carry LaTeX-only markup (\pagebreak and \usepackage[utf8]{inputenc}) that an HTML vignette ignores, and no longer show the date they were built on CRAN. The Sliced distributions vignette refers to the capped mean vignette by its title. o The exploratory scripts in tests/CappedMean, tests/PureIBNR and tests/SlicedDistributions are left out of the package tarball; they were never run by R CMD check. o DESCRIPTION: the third article is "Taken to excess", the Shiny tools are listed one by one, and testthat (>= 3.0.0) is required for the tests. README: a CRAN badge and a list of the vignettes. o PureIBNRGamma() and PureIBNRLNorm() compute the ratios from the unrounded pure IBNR duration. They divided the duration rounded to 0.01 days, so short periods lost precision (a one-hour period gave 0.96 instead of 1.00000, a week was wrong in the fourth decimal); ratios of long periods can change in the fifth decimal. o Shiny tools: charts are redrawn when the window is resized (legends used to overlap), and on Windows they are drawn with the cairo device when no other device is installed, with greyscale anti-aliasing, so the dark theme no longer shows smeared text, bright grid lines or coloured fringes on text. o GLM fitting tool: the downloaded model (RDS) no longer contains the Shiny session. It used to hold every input, including a database password typed on the Data tab, and was many times larger than the model itself. o GLM fitting tool: an import that fails keeps the data imported before, so the data and the fitted model stay together, and the Data tab says that the last import failed. o GLM fitting tool: the AIC of two stored models is marked "lower" only when they use the same weights; otherwise the models are shown as not comparable. o GLM fitting tool: after an import, the response defaults to a column whose name suggests one (such as claim_count or loss), and the chart variable to a column that is not an ID. Columns already chosen are kept. o GLM fitting tool: settings are saved as a plain text file ("glm_fitting_tool_settings.txt"), one "field: value" line per setting, and loading one never runs code. Settings files saved as .rds by earlier versions no longer load; save the settings again to get a text file. o GLM fitting tool: the database server, port, database name, user and SQL query are saved with the settings only when "Include database connection details" is ticked (off by default), so a shared file does not disclose internal infrastructure. The password is never saved. o GLM fitting tool: in the "Data with predictions" CSV download, text cells and column names that a spreadsheet would read as a formula (starting with =, +, -, @, a tab or a carriage return) are written with a leading ', so opening the file cannot run a formula from the uploaded data. Numbers are unchanged. o Claims simulator: values typed just after loading settings or an example are no longer set back to the loaded values on a slow machine, and fields that appear late (a slow browser) still start from the loaded values. o A failed parallel run no longer leaves a socket connection open: the worker that the future package relaunched after the error was never shut down, and R later warned "closing unused connection" in the console. o Distribution fitting tool: the Negative Binomial fit no longer falls back to the Poisson (size 1e8) on overdispersed claim counts; it finds the maximum likelihood size whenever the variance is above the mean, with or without weights, and matches MASS::fitdistr(). o Distribution fitting tool: the columns are guessed again after the separator or decimal mark is changed, while a column you chose is kept; the slicing point and piecewise Pareto threshold sliders no longer show overlapping tick labels. o Claims simulator: simulations whose total is undefined (NaN) are no longer dropped silently; the report, the summary and the Compare tab count them, and the statistics state how many simulations they use. Normal severities whose summed mean or standard deviation overflows add up the claims, as simulating every claim does, instead of giving NaN. o Claims simulator: very large values are shown as e.g. 1.000e+308 on the Compare tab and in the implied moments instead of hundreds of digits. o Claims simulator: switching a distribution or layer away and back, or switching the custom seed off and on, keeps the values typed. o Claims simulator: loading settings resets 'Truncate at zero' and clears unused Pareto slices; quick 'Add slice' clicks each add a slice. o Claims simulator: layout fixes for the navbar brand, the example list (two examples have shorter names), the Compare table labels and the return-period chart's "1 in 200" label, which stays inside the chart. o Claims simulator: report charts of one simulation or of equal totals are drawn sensibly; the 95% range for the mean is not below zero for totals that cannot be negative and is labelled a normal approximation; the tail count is now "Simulations at or beyond VaR 99.5%" and TVaR is documented as the mean of the worst ceiling(n x (1 - p)) simulations. o simulate_claims() and simulate_function(): the documentation of number_of_reinstatements_used says that with an aggregate "exclude" layer the reinstatements are counted before the exclusion. o Claims simulator: the report and the Compare tab no longer fail for a run whose totals include both +Inf and -Inf when a reinsurance structure is set. o Claims simulator: the report explains undefined (NaN) totals by their cause (claims that overflowed to both +Inf and -Inf, or an infinite amount meeting a layer with an infinite deductible or limit) instead of always blaming an excluded layer with an infinite limit. o Claims simulator: the Compare tab shows infinite values as Inf or -Inf in every row, keeps the dash for undefined values, and says what both mean; the report uses the singular wherever a count is one ("1 simulation"). o Shiny tools: the header stays on one row from 992 px wide, and on narrow screens the app name gives way to the menu button instead of pushing it off the page. o Claims simulator: settings files are plain text (.txt) files that can be read and compared, and loading one never runs code. Old .rds settings files no longer load; save the settings again from this version. o Claims simulator: the Compare tab's return-period chart is drawn with base R graphics. It follows the app's light, dark or system theme and wraps its legend at narrow widths; it no longer shows values on hover. o Parallel runs of simulate_function() use the future package directly instead of future.apply. Seeded results are unchanged, sequential and parallel. o simulate_function() and simulate_claims() return totals, gross claims and reinstatements used at full precision; they were rounded to two decimals, which distorted results for small amounts (e.g. in millions). The app and the report round only for display, and small amounts keep about three significant digits. o Results change when an each-and-every-loss layer with limited reinstatements is combined with an aggregate deductible. The aggregate deductible now comes off the year's layer recoveries before the aggregate limit and the reinstatement capacity cap them (the market convention): three claims of 100 through 100 xs 0 with no reinstatements and an aggregate deductible of 50 now cede 100, not 50. Reinstatements used are counted after the deductible. o The chance that all reinstatements are used, and the chance the layers are exhausted, are exact rather than counting amounts just below the limit. o Infinite distribution parameters, numbers of simulations, seeds, chunk sizes, slice alphas and numbers of reinstatements are rejected with a clear message. Inf is still allowed for the cap, deductibles, limits and slice thresholds. o apply_deductible_limit() stops on a negative deductible or limit, and its documentation describes what it returns for each structure. o PureIBNRGamma() and PureIBNRLNorm() count days on each date's own calendar and clock, so Date, POSIXct and mixed inputs agree and results no longer depend on the time zone or daylight saving (a mix of Date and POSIXct used to report the whole period as unearned). Results can change in the second decimal where the time zone had shifted them. Non-date input and expiry dates before inception dates are errors. o The capped mean, exposure curve, ILF and sliced distribution functions stop with a clear error on non-positive parameters or negative caps, instead of returning plausible-looking numbers. NA parameters still give NA. o ParetoCappedMean(), ExposureCurvePareto() and the sliced functions accept zero-length input (returning numeric(0)) and keep matrix dimensions and names. o LNormCappedMean() no longer overflows to NaN or Inf for large sigmas, and dSlicedGammaPareto() and dSlicedLNormPareto() no longer overflow for large slice points or shapes. erf() is accurate near zero. The sliced functions give the attritional distribution for an infinite slice point, instead of NaN. o The PureIBNR vignette computes its theoretical pure IBNR count rather than hard-coding it. o Distribution fitting tool: the Gamma fit gives the exact maximum likelihood estimate at any scale; claims of 1e9 or more got a wrong shape. o Fitting tools data upload: with a decimal comma, points are read as thousands separators ("15.000,5" is 15000.5), and files with a separator at the end of each row are read correctly (the columns were shifted by one, or the file failed to load). o GLM fitting tool: "." in a formula (also ". - x", ".^2") leaves out the offset and weights columns, empty or single-valued columns, and text columns with very many values such as IDs, and says which were left out. o GLM fitting tool: explains formulas it cannot read, text responses for non-binomial families, single-valued predictors and columns with no values, instead of showing R errors; reads numbers with thousands separators ("1,200") as numbers; chart labels mention exposure only when the offset is used as one. o Distribution fitting tool: the first piecewise Pareto layer includes the smallest claim; all-zero claim counts give a clear message instead of failed fits; very large and very small numbers are shown in scientific notation, and large weighted totals in full. Changes in Version 0.3.0 o Fewer dependencies: plotly, reactable, fitdistrplus, future.apply and htmltools are no longer imported, so installing NetSimR installs 35 packages instead of 82. The charts of the three Shiny tools are drawn with base R graphics, the tables are plain HTML, and the Poisson and Negative Binomial fits of the distribution fitting tool are computed directly, with the same results as before. o Distribution fitting and GLM fitting tools: the charts follow the light or dark theme; they no longer show values on hover or zoom. The data previews show the first 100 rows in a table that scrolls both ways, instead of a searchable table. o Distribution fitting tool: the Poisson and Negative Binomial fits are the exact maximum likelihood estimates (fitdistrplus's optimiser stopped slightly short of the maximum). When the counts are not overdispersed the Negative Binomial tends to the Poisson; its size is then set to 1e8, with a note. o Distribution fitting tool: suggests the Negative Binomial only when its fit has the lower AIC (the suggestion could contradict the fit table); the frequency histogram labels counts from 2^31 up in full (they read "NA") and its last bin ends at the largest count; the mean excess chart explains that it needs three different claim sizes instead of drawing an empty chart. o Fitting tools: the data preview shows the first 50 columns and opens at once for wide files (1,000 columns took about 20 seconds). o GLM fitting tool: the actual against predicted chart fits its left axis to the values, so a response around 1,000 no longer draws as a flat line; its bands read "18-24" rather than "(18.0006,23.9723]"; a text variable with more than 100 values gives a message instead of hundreds of bars. o Claims simulator: the Compare tab's return-period chart shows runs with negative totals (e.g. a Normal severity with a negative mean); its y axis used to start at zero. The chart's x axis reaches 1 in 1,000,000. o Simulation report: runs with infinite totals (e.g. a Pareto severity with a very small alpha) no longer fail with "need finite 'ylim' values". The charts leave infinite totals out with a note, the tables show Inf, and a ceded or net column that would be infinite minus infinite is left blank instead of showing NaN. Very large amounts are shown in scientific notation. o simulate_function(): a seedValue given without seedSetBinary fixes the seed (seedSetBinary defaults to TRUE when seedValue is given); it used to be ignored. o apply_deductible_limit(): an NA, missing or unknown reinsurance_structure, or more than one, is an error that lists the options. o The capped mean, exposure curve, ILF, sliced distribution and pure IBNR functions stop with " must be numeric" for non-numeric input, and all of them treat lengths that do not recycle as an error. GammaCappedMean(), LNormCappedMean(), IGamma() and the ILF functions used to recycle them with a warning. Results for valid input are unchanged. o PureIBNRGamma() and PureIBNRLNorm(): one period with several parameter values or valuation dates gives the right ratios on every row; rows after the first used to repeat the first row's ratios. o New vignette "Simulating claims with simulate_claims()". Help pages link related functions, and internal objects are hidden from the index. Vignette typos are corrected. Changes in Version 0.2.0 o Fewer dependencies: rmarkdown, shinybusy, data.table, scales, shinyjs, MASS and Pareto are no longer imported. The Gamma maximum likelihood fit and the piecewise Pareto fit of the distribution fitting tool are now computed with base R and give the same results as before. o The database drivers of the GLM fitting tool (DBI, RMySQL, RSQLite, RODBC, RPostgreSQL) moved from Imports to Suggests, so they are no longer installed with the package. The tool shows a message naming the package to install when a database type is selected whose driver is missing. o The GLM and distribution fitting tools raise the shiny upload limit only while they run and restore the option when they stop; loading the package no longer changes options(shiny.maxRequestSize). o GammaCappedMean() and LNormCappedMean() are computed with pgamma() and pnorm() directly: no NaN for large shapes (gamma() overflow) and no loss of precision for caps far above or far below the mean. Results elsewhere are unchanged up to floating point. o ParetoCappedMean() with shape == 1 uses the exact limit scale * (1 + log(cap / scale)) instead of averaging shape +/- 0.0001; values change by less than 1e-6 relative to before. o An infinite cap now gives the uncapped mean (or Inf when the mean is infinite) in the capped mean, exposure curve and ILF functions, instead of NaN. o Distribution fitting tool: the mean excess function plot now shows the empirical mean excess of the claims (mean of the claims above each point, less the point) instead of a mean over the plotted grid points; fitting errors are shown in the app instead of the console; the severity cdf plots are labelled correctly when the log scale is off. o GLM fitting tool: model fitting errors are shown in the app. o IGamma() documentation corrected: it is the upper incomplete gamma function. o Added examples to run_shiny_glm_fitting_tool() and run_shiny_distribution_fitting_tool(), and a testthat suite. o Claims simulator: redesigned interface with light, dark and system themes; a Report tab that shows the full report inside the app; a Compare tab that keeps up to six runs with side-by-side metrics and a return-period chart; save and load of settings, and three built-in examples. o Claims simulator inputs: clearer parameter labels, the implied mean and standard deviation of each distribution shown while typing, number boxes for the simulations and seed, and checks that name any missing or invalid setting before a run (including whole-number claim counts and increasing Pareto slice thresholds). o New option to truncate Normal claim sizes at zero, so no claim is negative (argument sevTruncateAtZero of simulate_function()). o simulate_function() also returns the gross total claims before reinsurance, works outside a Shiny session, reuses running parallel workers and has examples. o The simulation report is built in R and no longer needs pandoc or rmarkdown. It adds gross, ceded and net figures, layer metrics, simulation accuracy, claim frequency and return periods, and follows the light or dark theme. TVaR now averages exactly the worst share of simulations. o Shiny's built-in busy indicators replace the shinybusy package in the simulator and the GLM fitting tool. o simulate_function() checks every distribution parameter against its range (e.g. Poisson mean at least 0, Binomial probability between 0 and 1, positive Gamma, Exponential and Pareto parameters) and checks that deductibles, the cap and reinstatements are not negative and that limits are positive, instead of failing or returning NA part-way through a run. The Normal mean and the Log-Normal mu may now be negative, and the implied moments are shown for them. o simulate_function() random numbers: every chunk of simulations has its own L'Ecuyer-CMRG stream, so a run gives the same results in sequence and in parallel, and a fixed seed no longer changes the caller's random number stream. Results for a given seed differ from earlier versions. o simulate_function() is faster: Pareto slices are drawn in one step; when nothing acts on individual claims, each year's total is drawn at once for Normal, Gamma, Exponential and fixed severities; with the new argument gross = FALSE and an each-and-every-loss layer only the claims that reach the layer are drawn. The chunk size adapts to the expected number of claims (new default chunk_size = NULL), which keeps memory use flat for high claim frequencies. The new argument shortcuts = FALSE turns the shortcuts off. o simulate_function() has defaults for every optional argument, a progress argument for progress reporting, and no longer calls Shiny itself. o The Normal severity has its own parameter ids in the simulator, so values no longer carry over between the Normal and the Log-Normal. Settings files saved by earlier versions still load. o Distribution fitting tool: redesigned interface in the style of the simulator, with light, dark and system themes (system by default), summary tiles, result tables that mark the best fit, and charts that follow the theme. Messages replace errors when a column cannot be used, and the column lists default to likely count, amount and weight columns. o Distribution fitting tool data upload: decimal comma option, thousands separators such as "1,234.5" read as numbers, a UTF-8 byte order mark no longer ends up in the first column name, column names are kept as in the file, and the preview is capped at 10,000 rows. o Distribution fitting tool fixes: weighted frequency fits keep each count with the weight of its own row, and the weighted choice is fixed when the analysis runs; the mean, variance and suggestion use the weights; claim counts and weights must be whole numbers (non-integer counts gave a meaningless Negative Binomial fit). The Kolmogorov-Smirnov figures are now the distance of stats::ks.test() in every tab (before, a scaled statistic based on rank / (n + 1)). The single Pareto cdf is zero below its threshold instead of negative. The sliced LogNormal body allows a negative mu (claims below 1 were fitted with mu held at 0.0001). The Gamma fit no longer fails on small whole numbers or claims far below 1. Severity cdfs of claims below 1,000 are drawn on a fine grid instead of whole numbers, and the log scale uses a log axis. o GLM fitting tool: redesigned interface in the style of the simulator, with light, dark and system themes (system by default); CSV separator, decimal and quote options; links offered per family with the family's default; column buttons that add terms to the formula; a coefficient table with relativities or odds ratios; tiles for AIC, deviance explained and dispersion; and download buttons that appear once a model is fitted. o GLM fitting tool fixes: an offset can be the log of an exposure column (the column was always used raw, so an exposure gave a wrong model); the actual against predicted chart uses the fitted model's columns, divides by the exposure only when it is one, weighs rows by the weights, and offers bands of equal counts. A stored model keeps the AIC, family, link and offset of the model it was fitted with (before, the AIC of whatever was fitted last was shown next to the saved formula) and marks the lower AIC when the models are comparable. Predictions no longer fail on a factor level found only in rows the fit left out. Fit warnings are shown instead of hidden, text binomial responses are read as factors, "." stands for every other column, and import errors show the actual error in a dialog that can be closed. o GLM fitting tool settings file: only the import options and model choices are kept, never the database password; loading checks the file and applies the column choices once the data is imported. Files saved by earlier versions still load. o Distribution fitting tool sliders: slicing points start at the 75th and 95th percentiles with a fine step, moving the first past the second moves only the second, and piecewise Pareto thresholds start at the 50th, 75th, 87.5th, ... percentiles and are kept when the number of thresholds changes. o Claims simulator: up to six Pareto slices, added with an Add slice button and removed with a button on each slice; removing a slice moves the later slices up. The switch and the number-of-slices list are gone. Settings files saved with the old switch still load. o New simulate_claims(): a simpler interface to simulate_function() with short argument names (n_sims, frequency, severity_params, eel_layer, agg_limit, ...), distributions chosen by name in any case, parameters that may be named, and defaults for every optional feature. o ParetoCappedMean() now returns the cap when it is at or below the scale (it gave wrong values, 0 or NaN before), which also fixes ExposureCurvePareto() and ILFPareto() for small limits, and it stays accurate for shapes very close to 1. o The sliced Gamma-Pareto and LogNormal-Pareto functions work with vectors of parameters (extra values were silently dropped, and the exposure curve could return wrong values). qSlicedGammaPareto() and qSlicedLNormPareto() stay accurate for probabilities very close to 1. IGamma() no longer returns Inf for large shapes when the result is finite. o simulate_claims() checks that gross, shortcuts, parallel and truncate_at_zero are a single TRUE or FALSE, and gives a clearer error when distribution parameters mix named and unnamed values. o GLM fitting tool: the actual against predicted chart codes a binomial response as glm() does, so a text response with more than two values shows the share of responses other than the first value, and an all-TRUE logical response is no longer treated as failures. The app says which value it takes as failure when a text response has more than two values. o GLM fitting tool: the download section explains that the saved model refers to its data as model_data, so update() needs the data assigned to model_data or passed as data =. o Distribution fitting tool: the sliced Pareto table note says that the alpha of the layer between the slicing points is a least-squares fit; only the tail alphas are maximum likelihood estimates. o Claims simulator: a failed run keeps the previous results, downloads and results tabs, and shows the error. o Claims simulator: the app restores the user's future plan when the session ends or a run fails, and only shuts down workers it started. o Seeds outside the integer range are rejected with a clear message, and a fixed seed gives the same results whatever the caller's RNGkind(). o Claims simulator: the number of simulations input accepts 1 to 10,000,000, the same range as the validation. o bslib 0.9.0 or later is required. Changes in Version 0.1.6 o Updated the shiny simulation tool. Changes in Version 0.1.5 o Added database name in inputs of glm database o Increased the maximum csv file size for glm builder and distribution fitting to 64gb o Fixed bug loading inputs for GLM builder o Added piecewise pareto fit to distribution fitting tool Changes in Version 0.1.4 o Added port selection for sql and prioritised csv input in Shiny glm fitting tool. o Added distribution fitting tool Changes in Version 0.1.3 o Added Shiny glm fitting tool. Changes in Version 0.1.2 o Added shiny simulation tool. Changes in Version 0.1.1 o Updates a dependency to the rmarkdown package. Changes in Version 0.1.0 o First official release of the package on CRAN. The accompanying articles are listed in the package description.