Skip to content

Commit

Permalink
decreased min pop in age group to 0
Browse files Browse the repository at this point in the history
  • Loading branch information
hanase committed May 22, 2024
1 parent db316d5 commit f10a48c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>
Depends: R (>= 3.5.0), bayesTFR (>= 7.1-0), bayesLife (>= 5.0-0), MortCast (>= 2.6-1)
Expand Down
2 changes: 1 addition & 1 deletion R/predict.pop.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/projection_functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f10a48c

Please sign in to comment.