Changes in Version 0.1.0

  o First official release of the package on CRAN. The accompanying articles
    are listed in the package description.


Changes in Version 0.1.1

  o Updates a dependency to the rmarkdown package.


Changes in Version 0.1.2

  o Added shiny simulation tool.


Changes in Version 0.1.3

  o Added Shiny glm 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.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.6

  o Updated the shiny simulation tool.

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.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 "<argument> 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.
  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.
