uk.ac.leeds.ccg.andyt.projects.genesis.society.demography
Class GENESIS_MortalityAndFertilityEstimator

java.lang.Object
  extended by uk.ac.leeds.ccg.andyt.projects.genesis.io.schema.population.PopulationType
      extended by uk.ac.leeds.ccg.andyt.projects.genesis.society.demography.GENESIS_MortalityAndFertilityEstimator
All Implemented Interfaces:
java.io.Serializable

public class GENESIS_MortalityAndFertilityEstimator
extends uk.ac.leeds.ccg.andyt.projects.genesis.io.schema.population.PopulationType
implements java.io.Serializable

A class for loading annual death counts by age and gender, annual birth counts by age of mother for a single area and for estimating the annual mortality and fertility rates for the area based on the start population and estimated annual mortality and fertility rates. (The estimates are usually the mortality and fertility rates from the previous year or some general mortality or fertility rates). The resulting estimates are produced by an iterative method which adjust expected rates until there is a convergence and the observed numbers of birth and death are expected from the estimated rates from the start population.

See Also:
Serialized Form

Field Summary
 GENESIS_Population _EstimatedEndYearPopulation
          Estimated End Year Population
 GENESIS_Population _EstimatedMidYearPopulation
          Estimated Mid Year Population
 GENESIS_Environment _GENESIS_Environment
           
 GENESIS_Fertility _InitialEstimateOfFertility
          Initial Fertility Estimate
 GENESIS_Mortality _InitialEstimateOfMortality
          Initial Mortality Estimate
 GENESIS_Population _ObservedAnnualBirthsByAgeOfMother
          For storing the Observed Annual Birth Count data
 GENESIS_Population _ObservedAnnualDeaths
          For storing the Observed Annual Death Count data
 GENESIS_Population _StartYearPopulation
          Initial Population
protected static long serialVersionUID
           
 
Fields inherited from class uk.ac.leeds.ccg.andyt.projects.genesis.io.schema.population.PopulationType
genderedAgeBoundPopulation
 
Constructor Summary
GENESIS_MortalityAndFertilityEstimator()
           
GENESIS_MortalityAndFertilityEstimator(GENESIS_Environment _GENESIS_Environment)
           
GENESIS_MortalityAndFertilityEstimator(GENESIS_Environment _GENESIS_Environment, GENESIS_Population _ObservedAnnualDeaths, GENESIS_Population _ObservedAnnualBirthsByAgeOfMother, GENESIS_Population _StartYearPopulation, GENESIS_Mortality _InitialEstimateOfMortality, GENESIS_Fertility _InitialEstimateOfFertility)
           
 
Method Summary
 java.util.TreeMap<java.lang.Integer,java.util.TreeMap<java.lang.String,java.util.TreeMap<GENESIS_AgeBound,java.lang.Long>>> formatSourceBirthData(java.io.File directory, java.lang.String filename)
           
 java.util.TreeMap<java.lang.Integer,java.util.TreeMap<java.lang.String,java.util.TreeMap<GENESIS_AgeBound,java.lang.Long>>> formatSourceDeathData(java.io.File directory, java.lang.String filename)
           
static java.lang.Object[] getEstimateRates(GENESIS_Population startYearPopulation, GENESIS_Mortality initialEstimateOfMortality, GENESIS_Fertility initialEstimateOfFertility, GENESIS_Population birthPopulation, GENESIS_Population deathPopulation, int decimalPlacePrecision, java.math.RoundingMode roundingMode)
           
static GENESIS_Fertility getInitialEstimateOfFertility(GENESIS_Population initialPop, GENESIS_Population birthPop, java.math.BigDecimal twinProbability, java.math.BigDecimal tripletProbability, GENESIS_Environment theGENESIS_Environment, int decimalPlaces, java.math.RoundingMode roundingMode)
           
static GENESIS_Mortality getInitialEstimateOfMortality(GENESIS_Population initialPop, GENESIS_Population deathPop, GENESIS_Environment theGENESIS_Environment, int decimalPlaces, java.math.RoundingMode roundingMode)
           
static java.util.logging.Logger getLogger()
           
static java.lang.Object[] getMortalityAndFertilityEstimate(java.lang.String aLADCode, int year, java.math.BigDecimal twinProbability, java.math.BigDecimal tripletProbability, GENESIS_Environment theGENESIS_Environment, int decimalPlaces, java.math.RoundingMode roundingMode)
           
static uk.ac.leeds.ccg.andyt.projects.genesis.io.schema.population.PopulationType loadBirthXMLData(java.io.File dataDirectory, java.lang.String birthDataDirectoyName, int year, java.lang.String aLADCode)
           
static uk.ac.leeds.ccg.andyt.projects.genesis.io.schema.population.PopulationType loadDeathXMLData(java.io.File dataDirectory, java.lang.String deathDataDirectoyName, int year, java.lang.String aLADCode)
           
static void main(java.lang.String[] args)
           
 java.lang.Object[] run(int year, java.lang.String aLADCode, java.math.BigDecimal twinProbability, java.math.BigDecimal tripletProbability, GENESIS_Population initialPop, GENESIS_Mortality initialEstimateOfMortality, GENESIS_Fertility initialEstimateOfFertility, GENESIS_Population birthPop, GENESIS_Population deathPop, int decimalPlaces, java.math.RoundingMode roundingMode)
           
 void runFormatData()
           
 void runTest()
           
static void saveBirthDataToXML(java.io.File dataDirectory, java.util.TreeMap<java.lang.Integer,java.util.TreeMap<java.lang.String,java.util.TreeMap<GENESIS_AgeBound,java.lang.Long>>> birthData)
           
static void saveDeathDataToXML(java.io.File dataDirectory, java.util.TreeMap<java.lang.Integer,java.util.TreeMap<java.lang.String,java.util.TreeMap<GENESIS_AgeBound,java.lang.Long>>> femaleDeathData, java.util.TreeMap<java.lang.Integer,java.util.TreeMap<java.lang.String,java.util.TreeMap<GENESIS_AgeBound,java.lang.Long>>> maleDeathData)
           
 void writeEstimatedMortalityAndFertility(java.io.File dataDirectory, java.lang.Object[] estimatedMortalityAndFertility)
           
 
Methods inherited from class uk.ac.leeds.ccg.andyt.projects.genesis.io.schema.population.PopulationType
getGenderedAgeBoundPopulation, setGenderedAgeBoundPopulation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

protected static final long serialVersionUID
See Also:
Constant Field Values

_GENESIS_Environment

public transient GENESIS_Environment _GENESIS_Environment

_ObservedAnnualDeaths

public GENESIS_Population _ObservedAnnualDeaths
For storing the Observed Annual Death Count data


_ObservedAnnualBirthsByAgeOfMother

public GENESIS_Population _ObservedAnnualBirthsByAgeOfMother
For storing the Observed Annual Birth Count data


_StartYearPopulation

public GENESIS_Population _StartYearPopulation
Initial Population


_InitialEstimateOfMortality

public GENESIS_Mortality _InitialEstimateOfMortality
Initial Mortality Estimate


_InitialEstimateOfFertility

public GENESIS_Fertility _InitialEstimateOfFertility
Initial Fertility Estimate


_EstimatedEndYearPopulation

public GENESIS_Population _EstimatedEndYearPopulation
Estimated End Year Population


_EstimatedMidYearPopulation

public GENESIS_Population _EstimatedMidYearPopulation
Estimated Mid Year Population

Constructor Detail

GENESIS_MortalityAndFertilityEstimator

public GENESIS_MortalityAndFertilityEstimator()

GENESIS_MortalityAndFertilityEstimator

public GENESIS_MortalityAndFertilityEstimator(GENESIS_Environment _GENESIS_Environment)

GENESIS_MortalityAndFertilityEstimator

public GENESIS_MortalityAndFertilityEstimator(GENESIS_Environment _GENESIS_Environment,
                                              GENESIS_Population _ObservedAnnualDeaths,
                                              GENESIS_Population _ObservedAnnualBirthsByAgeOfMother,
                                              GENESIS_Population _StartYearPopulation,
                                              GENESIS_Mortality _InitialEstimateOfMortality,
                                              GENESIS_Fertility _InitialEstimateOfFertility)
Method Detail

main

public static void main(java.lang.String[] args)

runTest

public void runTest()

run

public java.lang.Object[] run(int year,
                              java.lang.String aLADCode,
                              java.math.BigDecimal twinProbability,
                              java.math.BigDecimal tripletProbability,
                              GENESIS_Population initialPop,
                              GENESIS_Mortality initialEstimateOfMortality,
                              GENESIS_Fertility initialEstimateOfFertility,
                              GENESIS_Population birthPop,
                              GENESIS_Population deathPop,
                              int decimalPlaces,
                              java.math.RoundingMode roundingMode)

writeEstimatedMortalityAndFertility

public void writeEstimatedMortalityAndFertility(java.io.File dataDirectory,
                                                java.lang.Object[] estimatedMortalityAndFertility)

getMortalityAndFertilityEstimate

public static java.lang.Object[] getMortalityAndFertilityEstimate(java.lang.String aLADCode,
                                                                  int year,
                                                                  java.math.BigDecimal twinProbability,
                                                                  java.math.BigDecimal tripletProbability,
                                                                  GENESIS_Environment theGENESIS_Environment,
                                                                  int decimalPlaces,
                                                                  java.math.RoundingMode roundingMode)
Returns:
Object[] result where result[0] is the Annual Mortality, result[1] is the Annual Fertility

getInitialEstimateOfFertility

public static GENESIS_Fertility getInitialEstimateOfFertility(GENESIS_Population initialPop,
                                                              GENESIS_Population birthPop,
                                                              java.math.BigDecimal twinProbability,
                                                              java.math.BigDecimal tripletProbability,
                                                              GENESIS_Environment theGENESIS_Environment,
                                                              int decimalPlaces,
                                                              java.math.RoundingMode roundingMode)

getInitialEstimateOfMortality

public static GENESIS_Mortality getInitialEstimateOfMortality(GENESIS_Population initialPop,
                                                              GENESIS_Population deathPop,
                                                              GENESIS_Environment theGENESIS_Environment,
                                                              int decimalPlaces,
                                                              java.math.RoundingMode roundingMode)

loadBirthXMLData

public static uk.ac.leeds.ccg.andyt.projects.genesis.io.schema.population.PopulationType loadBirthXMLData(java.io.File dataDirectory,
                                                                                                          java.lang.String birthDataDirectoyName,
                                                                                                          int year,
                                                                                                          java.lang.String aLADCode)

loadDeathXMLData

public static uk.ac.leeds.ccg.andyt.projects.genesis.io.schema.population.PopulationType loadDeathXMLData(java.io.File dataDirectory,
                                                                                                          java.lang.String deathDataDirectoyName,
                                                                                                          int year,
                                                                                                          java.lang.String aLADCode)

runFormatData

public void runFormatData()

formatSourceDeathData

public java.util.TreeMap<java.lang.Integer,java.util.TreeMap<java.lang.String,java.util.TreeMap<GENESIS_AgeBound,java.lang.Long>>> formatSourceDeathData(java.io.File directory,
                                                                                                                                                         java.lang.String filename)

formatSourceBirthData

public java.util.TreeMap<java.lang.Integer,java.util.TreeMap<java.lang.String,java.util.TreeMap<GENESIS_AgeBound,java.lang.Long>>> formatSourceBirthData(java.io.File directory,
                                                                                                                                                         java.lang.String filename)

saveBirthDataToXML

public static void saveBirthDataToXML(java.io.File dataDirectory,
                                      java.util.TreeMap<java.lang.Integer,java.util.TreeMap<java.lang.String,java.util.TreeMap<GENESIS_AgeBound,java.lang.Long>>> birthData)

saveDeathDataToXML

public static void saveDeathDataToXML(java.io.File dataDirectory,
                                      java.util.TreeMap<java.lang.Integer,java.util.TreeMap<java.lang.String,java.util.TreeMap<GENESIS_AgeBound,java.lang.Long>>> femaleDeathData,
                                      java.util.TreeMap<java.lang.Integer,java.util.TreeMap<java.lang.String,java.util.TreeMap<GENESIS_AgeBound,java.lang.Long>>> maleDeathData)

getEstimateRates

public static java.lang.Object[] getEstimateRates(GENESIS_Population startYearPopulation,
                                                  GENESIS_Mortality initialEstimateOfMortality,
                                                  GENESIS_Fertility initialEstimateOfFertility,
                                                  GENESIS_Population birthPopulation,
                                                  GENESIS_Population deathPopulation,
                                                  int decimalPlacePrecision,
                                                  java.math.RoundingMode roundingMode)
Parameters:
startYearPopulation -
initialEstimateOfMortality -
initialEstimateOfFertility -
birthPopulation -
deathPopulation -
decimalPlacePrecision -
roundingMode -
Returns:
result where; result[0] is the estimated mortality rate; result[1] is the estimated fertility rate

getLogger

public static java.util.logging.Logger getLogger()