Skip to content

Inconsistency in timing of dead counts in time-variant model #46

@alburezg

Description

@alburezg

Inconsistency in timing of dead counts in time-variant model (kin_time_variant_2sex)

There appears to be a mismatch between the timing of mortality rates and the reported dead counts in the time-variant implementation of kin_time_variant_2sex.

Description

Within the main loop, results are stored as:

for (t in 1:n_years_data) {
  kin_all[[t + 1]] <- ...
}

This produces a list kin_all of length n_years_data + 1. However, names are assigned as:

names(kin_all) <- as.character(years_data)

Since years_data has length n_years_data, the final element (kin_all[[n_years_data + 1]]) is left unnamed (NA) and is not selected downstream (e.g. in output_period_cohort_combination).

Consequence

The practical effect is that:

  • dead reported for year Y reflects mortality rates from year Y−1,
  • while deaths computed using the rates of the final input year are effectively dropped.

Wanted behaviour

kin_full$dead at time Y should reflect mortality rates at time Y.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions