View source: R/knn_get_index_year.R
knn_get_index_year | R Documentation |
For an index gage, select the years that are closest to a flow that needs to be disaggregated, based on k-nearest neighbor selection.
knn_get_index_year(
ann_flow,
ann_index_flow,
k_weights = knn_params_default(nrow(ann_index_flow)),
random_seed = NULL
)
ann_flow |
A 2-column matrix, with years in column 1, and an annual flow in column 2. This is the annual flow that needs to be disaggregated. |
ann_index_flow |
A 2-column matrix, with years in column 1, and an
annual flow in column 2. This is the index gage that the flows in
|
k_weights |
A |
random_seed |
A single integer or |
N x 1 matrix of index years, with the number of rows, equal to the
number of rows in ann_flow
.
Nowak, K., Prairie, J., Rajagopalan, B., Lall, U. (2010). A nonparametric stochastic approach for multisite disaggregation of annual to daily streamflow. Water Resources Research.
knn_params()
, knn_params_default()
# a sample of three years of flow data
flow_mat <- cbind(c(2000, 2001, 2002), c(1400, 1567, 1325))
# made up historical data to use as index years
ind_flow <- cbind(1901:1980, rnorm(80, mean = 1500, sd = 300))
knn_get_index_year(flow_mat, ind_flow)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.