diff --git a/NEWS.md b/NEWS.md index 0b325c5..a6020ba 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +# fireSense_ignitionPredict (development version) + +- Comments only: the ignition and escape models from `fireSense_ignitionFit` use `count:poisson`, not Tweedie, and the comments now say so. + # fireSense_ignitionPredict 1.2.0 This release fixes two errors that changed how many fires the module predicted. Weather and landscape conditions are now compared against the conditions the model was fitted on; before, each year was compared only with itself, so every year looked average to the model and hot or dry years did not stand out. And when several fires started in the same area, the module could count more escaped fires than actually escaped; each escape is now counted once. Results will differ from earlier versions, and should be more realistic. diff --git a/fireSense_ignitionPredict.R b/fireSense_ignitionPredict.R index 92c1509..9d01067 100644 --- a/fireSense_ignitionPredict.R +++ b/fireSense_ignitionPredict.R @@ -164,7 +164,7 @@ IgnitionPredictRun <- function(sim) { if (rescaleVars) covsHere <- scaleAsFit(covsHere, f$ign$scaleData, "fireSense_IgnitionFitted") predsIgns[f$rows] <- foldMeanPrediction(f$ign, covsHere) } - igns <- rpois(NROW(predsIgns), lambda = predsIgns) # can't use rtweedie because don't know the dispersion parameter + igns <- rpois(NROW(predsIgns), lambda = predsIgns) # the ignition model is Poisson (count:poisson), so its prediction is the Poisson mean whHasIgns <- which(igns > 0) predsEscs <- rep(NA_real_, NROW(igCov)) @@ -172,7 +172,7 @@ IgnitionPredictRun <- function(sim) { rowsEsc <- intersect(whHasIgns, f$rows) covsHere <- igCov[rowsEsc] if (rescaleVars) covsHere <- scaleAsFit(covsHere, f$esc$scaleData, "fireSense_EscapeFitted") - # the escape model is tweedie, so can go above 1, below 0 rarely + # the escape model is Poisson (count:poisson), so its mean can go above 1, never below 0 predsEscs[rowsEsc] <- foldMeanPrediction(f$esc, covsHere, clamp01 = TRUE) } predsEscs <- predsEscs[whHasIgns]