Class UkhlsHoursDistribution

java.lang.Object
simpaths.data.UkhlsHoursDistribution

public class UkhlsHoursDistribution extends Object
UKHLS distribution of observed weekly hours worked (lhw), by sample type and gender. Labour categories with DistributionOption.OBSERVED_LHW use it to draw realised hours within their band, so that each hour is drawn with its observed share within the band. Loaded from input/ukhls_lhw_distribution.xlsx (see Parameters.USE_UKHLS_LHW_DISTRIBUTION), which has one sheet per sample type and gender, named e.g. "Couple_female", listing the frequency of each observed weekly hours value.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    Sample types, mirroring the samples of the labour-supply estimates in BenefitUnit; each names a sheet prefix.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    draw(String sheet, int min, int max, double u)
    Draws realised weekly hours in the band [min, max] from the distribution of the given sheet, so that each hour is drawn with probability equal to its observed share within the band (hours never observed are never drawn). u is the person's uniform draw.
    load(String file)
    Loads the distribution of every sample type and gender from the given Excel file.
    static String
    sheetFor(Person person)
    Sheet for the person's current sample type and gender.
    static String
     

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Method Details

    • load

      public static UkhlsHoursDistribution load(String file)
      Loads the distribution of every sample type and gender from the given Excel file.
    • sheetName

      public static String sheetName(UkhlsHoursDistribution.Sample sample, Gender gender)
    • sheetFor

      public static String sheetFor(Person person)
      Sheet for the person's current sample type and gender.
    • draw

      public int draw(String sheet, int min, int max, double u)
      Draws realised weekly hours in the band [min, max] from the distribution of the given sheet, so that each hour is drawn with probability equal to its observed share within the band (hours never observed are never drawn). u is the person's uniform draw. Returns -1 if the band has no observed frequency.