diff --git a/ChangeLog b/ChangeLog index 7e59eee..cc6c6cb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,8 @@ Argument pasfr.ignore.phase2 added to pop.predict.subnat. Additional steps for very young and very old child-bearing ages in kantorova.pasfr function. +Decreased minimum allowed population in an age group from 0.0005 to 0. + 10.0-0/1 (08/09/2023) ------ Making default datasets from wpp2022 work with pop.predict. diff --git a/DESCRIPTION b/DESCRIPTION index b80893a..4f4412a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: bayesPop Type: Package Title: Probabilistic Population Projection -Version: 10.0-1.9011 -Date: 2024-05-21 +Version: 10.0-1.9012 +Date: 2024-05-22 Author: Hana Sevcikova, Adrian Raftery, Thomas Buettner Maintainer: Hana Sevcikova Depends: R (>= 3.5.0), bayesTFR (>= 7.1-0), bayesLife (>= 5.0-0), MortCast (>= 2.6-1) diff --git a/R/predict.pop.R b/R/predict.pop.R index f0b17f1..bb88896 100644 --- a/R/predict.pop.R +++ b/R/predict.pop.R @@ -921,7 +921,7 @@ migration.totals2age <- function(df, ages = NULL, annual = FALSE, time.periods = # for zero total migration where a schedule has positive as well as negative part, shift the total migration by a little bit # so that we don't loose the schedule migtmp[totmig == 0 & !is.na(prop) & !is.na(prop.neg), totmig := sign(total.orig) * (if(annual) 0.001 else 0.005)] #totmigl[abs(totmig) > 0, min(abs(totmig))] - #if(debug) stop("") + if(debug) stop("") # use the negative schedule if total migration is negative and there is a different schedule for such cases migtmp[totmig < 0 & !is.na(prop.neg), prop := prop.neg][, prop.neg := NULL] migtmp[!is.na(prop), `:=`(is_pos_neg = sum(prop > 0) > 0 & sum(prop < 0) > 0), by = c(id.col, "year")] # prop can be NA if observed years are included diff --git a/src/projection_functions.c b/src/projection_functions.c index f485db9..a741b70 100644 --- a/src/projection_functions.c +++ b/src/projection_functions.c @@ -86,7 +86,7 @@ void CCM(int *nobserved, int *abridged, int *npred, double *MIGm, double *MIGf, double csfm[adim],csff[adim]; /* cohort separation factor males, females*/ - const double minpop = 0.0005; /* minimum accepted population */ + const double minpop = 0; /* 0.0005; minimum accepted population */ const double max_out_rate = -0.8; /* the maximum portion of population that can leave when using migration rates */ nrow = *migr;