Class PediatricGrowthTrajectory

  • All Implemented Interfaces:
    java.io.Serializable

    public class PediatricGrowthTrajectory
    extends java.lang.Object
    implements java.io.Serializable
    This class provides growth trajectories for individuals between 2 and 20. For a person, starting at age 2, the trajectory will set an age + 1 year BMI. The BMI will be selected by computing the person's current extended BMI Z score. The + 1 year extended BMI Z score will be selected from a normal distribution with a mean that is based on the previous score, correlation between extended BMI Z scores from year to year and difference in mean extended BMI Z scores from year to year.

    This method uses extended BMI Z Scores, which is a concept under development at CDC. The current growth charts, were not intended to be used beyond the 97th percentile. See: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4528342/

    Further, CDC growth chart data is from 1960-1990. CDC defines obesity in children as having a BMI at or above the 95th percentile for sex and age in months: https://www.cdc.gov/obesity/childhood/defining.html However, recent data shows that at least 18.5% of children have obesity: https://www.cdc.gov/obesity/data/childhood.html This oddly means that more than 18.5% of the population have a BMI greater than the 95th percentile.

    To account for these issues, this class uses correlations and means gathered from more recent NHANES data: https://wwwn.cdc.gov/nchs/nhanes/Default.aspx

    The class also uses extended BMI Z scores. For children with a BMI value less than the 95th percentile, regular Z scores are used. At or above the 95th percentile models BMI values as a half normal distribution with a parameter sigma that is age based. The value for sigma is calculated using a quadratic function with weights obtained by examining NHANES data ADD CITATION ONCE PUBLISHED BY CDC

    See Also:
    Serialized Form
    • Field Detail

      • SIGMA_FEMALE_A

        public static double SIGMA_FEMALE_A
      • SIGMA_FEMALE_B

        public static double SIGMA_FEMALE_B
      • SIGMA_FEMALE_C

        public static double SIGMA_FEMALE_C
      • SIGMA_MALE_A

        public static double SIGMA_MALE_A
      • SIGMA_MALE_B

        public static double SIGMA_MALE_B
      • SIGMA_MALE_C

        public static double SIGMA_MALE_C
      • ONE_YEAR

        public static long ONE_YEAR
      • NINETEEN_YEARS_IN_MONTHS

        public static int NINETEEN_YEARS_IN_MONTHS
    • Constructor Detail

      • PediatricGrowthTrajectory

        public PediatricGrowthTrajectory​(long personSeed,
                                         long birthTime)
        Starts a new pediatric growth trajectory. Selects a start BMI between 2 and 3 years old by pulling a weighted sample from NHANES.
        Parameters:
        personSeed - The person's seed to allow for repeatable randomization
        birthTime - The time the individual was born in the simulation
    • Method Detail

      • reverseWeightPercentile

        public double reverseWeightPercentile​(java.lang.String sex,
                                              double heightPercentile)
        Given the sex, BMI and height percentile at age 2, calculate the correct weight percentile.
        Parameters:
        sex - of the person to get the weight percentile for
        heightPercentile - or the person
        Returns:
        the weight percentile the person would have to be in, given their height percentile and BMI
      • generateNextYearBMI

        public void generateNextYearBMI​(Person person,
                                        long time)
        Generates a BMI for the person one year later. BMIs are generated based on correlations measured between years of age and differences in mean BMI. This takes into special consideration people at or above the 95th percentile, as the growth charts start to break down.
        Parameters:
        person - to generate the new BMI for
        time - current time
      • justBefore

        public PediatricGrowthTrajectory.Point justBefore​(long time)
        Finds the closest point occurring before the given time.
        Parameters:
        time - time of interest
        Returns:
        Point just before it or null if it doesn't exist
      • justAfter

        public PediatricGrowthTrajectory.Point justAfter​(long time)
        Finds the closest point occurring after the given time.
        Parameters:
        time - time of interest
        Returns:
        Point just after it or null if it doesn't exist
      • beforeInitialSample

        public boolean beforeInitialSample​(long time)
        Determines whether the given time is before or after the NHANES sample selected as the seed for this growth trajectory.
        Parameters:
        time - The time to check
        Returns:
        true if the time is before the sample
      • addPoint

        public void addPoint​(int ageInMonths,
                             long timeInSimulation,
                             double bmi)
        Adds a point to the end of the trajectory. It must be at the end of the trajectory, otherwise, it will throw an IllegalArgumentException.
        Parameters:
        ageInMonths - for the person at the point
        timeInSimulation - at the time of the point
        bmi - what the body mass index should be at that point in time
      • addPointFromPercentile

        public void addPointFromPercentile​(int ageInMonths,
                                           long timeInSimulation,
                                           double percentile,
                                           java.lang.String sex)
        Adds a point to the end of the trajectory. It must be at the end of the trajectory, otherwise, it will throw an IllegalArgumentException.

        Instead of providing a BMI, provide a percentile, which will get converted to a BMI

        Parameters:
        ageInMonths - for the person at the point
        timeInSimulation - at the time of the point
        percentile - the percentile
        sex - the sex of the individual
      • currentBMI

        public double currentBMI​(Person person,
                                 long time)
        Provides the BMI for the individual at the supplied time. If the time provided is beyond the current length of the trajectory, it will generate a new point in the trajectory, if that point will happen before the person is 20 years old.
        Parameters:
        person - to get the BMI for
        time - the time at which you want the BMI
        Returns:
        a BMI value
      • percentileToBMI

        public static double percentileToBMI​(double percentile,
                                             int ageInMonths,
                                             java.lang.String sex,
                                             double sigma)
        Uses extended percentiles when calculating a BMI greater than or equal to the 95th percentile.
        Parameters:
        percentile - BMI percentile {0 - 1}
        ageInMonths - of the person
        sex - of the person
        sigma - age based value to model the extended percentiles
        Returns:
        The BMI, offering a different value than the growth charts when above the 95th
      • extendedZScore

        public static double extendedZScore​(double bmi,
                                            int ageInMonths,
                                            java.lang.String sex,
                                            double sigma)
        Calculates the extended BMI Z Score. This is the regular Z Score when below the 95th percentile. Above that, a different, half normal distribution is used to model the values.
        Parameters:
        bmi - you want the Z Score for
        ageInMonths - of the person
        sex - of the person
        sigma - age based value to model the extended percentiles
        Returns:
        the extended Z Score
      • sigma

        public static double sigma​(java.lang.String sex,
                                   double age)
        Calculate the parameter needed to model the half normal distribution for BMI values at or above the 95th percentile.
        Parameters:
        sex - of the person
        age - of the person, precision matters! You probably don't want to pass an integer like value
        Returns:
        sigma to use in other calculations
      • loadCorrelations

        public static java.util.Map<java.lang.String,​PediatricGrowthTrajectory.YearInformation> loadCorrelations()
        Load correlations of extended BMI Z Scores from age year to age year.
        Returns:
        The correlations keyed by age year