I have a collection representing a collection (M, F) for each year.
To project the population over time, I must first make calculations with women so that I can calculate the percentage of newborn men and women based on the statistical constant of fertility in masculinity.
However, I have the first matrix that contains both men and women under the age of one year.
IList<AnnualPopulation> initialPopulation =
LoadMatrix<AnnualPopulation>(1, 2009);
Now, to first predict a population of women, I use the following:
IList<AnnualPopulation> initialWomenPopulation = (
from w in initialPopulation
where String.Equals("F", w.Gender)
select w
).FirstOrDefault();
And I have to take into account mortality rates both for the current (initial year (2009)) and for the year for which I want to project, from which I already have a mortality rate for each year.
IList<AnnualDeathRate> deathRates = LoadMatrix<AnnualDeathRate>(1, 2009)
2009 . , 2009 2010, , Linq.
AnnualDeathRate[] femaleDeathRates = (
from fdr in deathRates
where (string.Equals("F", fdr.Gender))
select fdr
).TakeWhile(dr =>
initialWomenPopulation.Year == dr.Year ||
dr.Year == initialWomenPopulation.Year + 1
).ToArray()
- ,
.Take(2) where dr.Year? - ?
- ?