USGS-R / rloadest

USGS water science R functions for LOAD ESTimation of constituents in rivers and streams.
Other
20 stars 19 forks source link

app3 #29

Open DLLORENZ opened 5 years ago

DLLORENZ commented 5 years ago

In the rush to get rloadest released, some applications did not really get completed. App3 is a case in point--the model is not really well resolved. Below are my suggestions for improving the model.

Figure 6 should be better commented and refined to better show the relation between flow and the timing of residuals. I suggest the code for figure 6 should be modified to:

# setSweave is required for the vignette. setSweave("app3_06", 5, 5) AA.pl <- timePlot(app3.calib$Date, residuals(app3.lra), Plot=list(what="points"), ytitle="Residuals") refLine(horizontal=0) # show water years refLine(vertical=as.Date("2001-10-01") + years(0:9)) # show low flow values in red picks <- app3.calib$Flow < median(app3.calib$Flow) addXY(app3.calib$Date[picks], residuals(app3.lra)[picks], Plot=list(what="points", color="red")) graphics.off()

The first sentence in the describing paragraph should be expanded from: The residuals for water-year 2002 are mostly greater than 0; those for watery-year 2003 are trending down and those for water-year 2004 are mostly less than 0. to: The residuals for water-year 2002 are mostly greater than 0 and lower than normal flow; those for water-year 2003 are trending down and those for water-year 2004 are mostly less than 0 and represent greater than normal flow.

The diagnostic plots should for the anomaly model should include HFV, which indicates that a second order fit is suggested for HFV. The improved model is: app3.lra <- loadReg(OrthoPhosphate.PO4 ~ a1yr + quadratic(HFV) + dectime(Date)

I got Bp down to about 13% and a much better E value.