Skip to content

Commit

Permalink
Merge pull request #24 from USEPA/develop
Browse files Browse the repository at this point in the history
CRAN v0.2.1
  • Loading branch information
michaeldumelle authored Aug 28, 2024
2 parents 7ea588b + 20850c1 commit ab39f12
Show file tree
Hide file tree
Showing 80 changed files with 6,940 additions and 4,597 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: SSN2
Title: Spatial Modeling on Stream Networks
Version: 0.2.0
Version: 0.2.1
Authors@R: c(
person(given = "Michael",
family = "Dumelle",
Expand Down
7 changes: 7 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# SSN2 0.2.1

## Minor Updates

* Enhanced numeric stability of deviance and pseudo R-squared for `ssn_glm()` models when `family = "beta"` [(#23)](https://github.com/USEPA/SSN2/issues/23).
* Updated `reexport.Rd` to reflect changes in `spmodel v0.8.0`'s handling of `AIC()` and `AICc()`.

# SSN2 0.2.0

## Major Updates
Expand Down
4 changes: 3 additions & 1 deletion R/get_model_stats_glm.R
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,9 @@ get_deviance_glm <- function(family, y, fitted_response, size, dispersion) {
} else if (family == "inverse.gaussian") {
half_deviance_i <- 0.5 * (y - fitted_response)^2 / (y * fitted_response^2)
} else if (family == "beta") {
constant <- log(gamma(fitted_response * dispersion)) + log(gamma((1 - fitted_response) * dispersion)) - log(gamma(y * dispersion)) - log(gamma((1 - y) * dispersion))
# has NA problem for large dispersion
# constant <- log(gamma(fitted_response * dispersion)) + log(gamma((1 - fitted_response) * dispersion)) - log(gamma(y * dispersion)) - log(gamma((1 - y) * dispersion))
constant <- lgamma(fitted_response * dispersion) + lgamma((1 - fitted_response) * dispersion) - lgamma(y * dispersion) - lgamma((1 - y) * dispersion)
half_deviance_i <- constant + (y - fitted_response) * dispersion * log(y) + ((1 - y) - (1 - fitted_response)) * dispersion * log(1 - y)
}
deviance_i <- 2 * half_deviance_i
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![cran checks](https://badges.cranchecks.info/worst/SSN2.svg)](https://cran.r-project.org/web/checks/check_results_SSN2.html)
[![R-CMD-check](https://github.com/USEPA/SSN2/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/USEPA/SSN2/actions/workflows/R-CMD-check.yaml)
[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
[![status](https://joss.theoj.org/papers/66fd932526762f8ccd8bd9c3954e0e3d/status.svg)](https://joss.theoj.org/papers/66fd932526762f8ccd8bd9c3954e0e3d)
[![status](https://joss.theoj.org/papers/10.21105/joss.06389/status.svg)](https://joss.theoj.org/papers/10.21105/joss.06389)
<!-- badges: end -->

# SSN2: Spatial Modeling on Stream Networks
Expand Down
4 changes: 2 additions & 2 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
url: ~
url: https://usepa.github.io/SSN2/
template:
bootstrap: 5
bootstrap: 3

3 changes: 2 additions & 1 deletion cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
This is a minor update that adds a few small features and bug fixes. Thank you.
This is a minor update that enhances stability and includes updates to `reexports.Rd`
to reflect changes in `spmodel v0.8.0`'s handling of `AIC()` and `AICc()`. Thank you.

-------

Expand Down
126 changes: 80 additions & 46 deletions docs/404.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ab39f12

Please sign in to comment.