USGS-WiM / NSSServices

Services to calculate National Streamflow statistics
https://streamstats.usgs.gov/nssservices
Other
2 stars 0 forks source link

Add association between statistic groups and regression types #94

Open kjacobsen16 opened 5 years ago

USGSPMM3 commented 5 years ago

I think we'll need to add a field in the database to associate each equation (not statistic groups) with the type of regression. For example, we have 3 primary regression types used: Ordinary least squares, weighted least squares, and generalized least squares. The methods for computing the confidence intervals change based on the type of regression equation. Once these associations are made, then we need to add the additional equations/methods and query the database to determine which method to use.

T&M report for confidence intervals: https://pubs.usgs.gov/tm/04/a12/tm4a12.pdf See equations 49 & 50.

kjacobsen16 commented 4 years ago

@USGSPMM3 I'm looking back on this now, and I think there's some confusion. In the NSS database, a regression type is equal to a statistic, so PK15 is a regression type. Each equation is already associated with a regression type when creating (the equation is also associated with a regression region and statistic group, you can see all the options when you add a new scenario in NSS).

What this issue is talking about is grouping regression types like PK 15 into a statistic group, like Peak Flow Statistics. I think this is mostly to help with sorting, or filtering, for example when you're creating a new equation and choose a regression type in NSS, it would be helpful if we could filter somehow (in fact, I think Ryan requested this in his recent review). Technically we can do it (https://test.streamstats.usgs.gov/nssservices/regressiontypes?statisticgroups=2), but it's associated based on the statistic groups from existing equations, so if a regression type isn't used in an equation, it's not going to come back with the statistic group filters.

Maybe I'm misunderstanding, and what you're saying is a separate issue altogether.

Edit: what you're talking about might be what we're calling the method field, issue here: https://github.com/USGS-WiM/NSSServices/issues/115