pq_slopes: P-Q signatures computations using Q, P and hdays vectors

Description Usage Arguments Details Value

View source: R/pq_approach.R

Description

It computes the cumulative inter-annual daily average of P and Q as well as the difference P-Q. Then, it computes the seasonal response change signatures following the so-called P-Q approach: breackpoint date, first period slope (dry), second period slope (wet) and the intercepts associated with these two slopes (only there for plotting purposes).

Usage

1
2
3
4
5
6
7
8
9
pq_slopes(
  Q,
  P,
  hdays,
  start = 15,
  end = 183,
  bp = mean(c(start, end)),
  intercept = TRUE
)

Arguments

Q

numeric vector. Streamflow values.

P

numeric vector. Precipitation values.

hdays

numeric vector. Days of the (Hydrological) years vector

start

numeric. The day number of the start of the period to search for a change of trend in P-Q.

end

numeric. The day number of the end of the period to search for a change of trend in P-Q.

bp

numeric value. The day number of the initial guess of threshold date

intercept

logical. Should the intercept be estimated (default: TRUE) or fixed to c(0, 0) (FALSE)?

Details

This function uses a segmented regression to find the dry and wet slopes. It also returns the intercepts of the two lines (which are not signatures) that can be used to plot the lines.

Value

Returned


IvanHeriver/hsa-R-package documentation built on Dec. 17, 2021, 11:32 p.m.