Learn R Programming

ldsr

Streamflow reconstruction using linear dynamical system. The method was described in Nguyen and Galelli (2018) and used in Nguyen et al (2019). Please cite Nguyen and Galelli (2018) when using the package.

To install this package, type the following commands into your RStudio console:

install.packages('devtools')
devtools::install_github('ntthung/ldsr', build_vignettes = TRUE)

Note that if you don't already have Rtools (a set of tools to build packages from sources), RStudio will prompt you to install it. Just follow the instructions. After Rtools installation is complete, type the above install_github command again.

To view the package's vignette, type

browseVignettes('ldsr')

References

Nguyen, H. T. T., & Galelli, S. (2018). A linear dynamical systems approach to streamflow reconstruction reveals history of regime shifts in northern Thailand. Water Resources Research, 54, 2057– 2077. https://doi.org/10.1002/2017WR022114

Nguyen, H. T. T., Turner, S. W., Buckley, B. M., & Galelli, S. (2019). Coherent streamflow variability in Monsoon Asia over the past eight centuries---links to oceanic drivers. https://doi.org/10.31223/osf.io/5tg68

Copy Link

Version

Install

install.packages('ldsr')

Monthly Downloads

197

Version

0.0.2

License

GPL (>= 2.0)

Issues

Pull Requests

Stars

Forks

Maintainer

Hung Nguyen

Last Published

May 4th, 2020

Functions in ldsr (0.0.2)

LDS_GA

Learn a linear dynamical system using Genetic Algorithm.
KGE

Kling-Gupta Efficiency
LDS_rep

Multiple LDS replicates
Kalman_smoother

Implement Kalman smoothing
LDS_BFGS

Learn LDS with L-BFGS-B
cvPCR

Cross validation of PCR reconstruction.
LDS_reconstruction

Learn LDS model.
make_init

Make initial values for parameters.
call_method

Call a reconstruction method
calculate_metrics

Reconstruction metrics
nRMSE

Normalized root-mean-square error
LDS_EM

Learn LDS model
exp_ci

Exponential confidence interval
negLogLik

Calculates the negative log-likelihood
Mstep

Maximizing expected likelihood using analytical solution
one_LDS_rep

One LDS replicate
corr

Pearson's correlation
LDS_EM_restart

Learn LDS model with multiple initial conditions
PCR_ensemble_selection

Select the best reconstruction
one_pcr_cv

One cross-validation run
one_lds_cv

One cross-validation run
LDS_BFGS_with_update

Learn LDS with L-BFGS-B
cvLDS

NSE

Nash-Sutcliffe Efficiency
NPannual

Annual streamflow at Nakhon Phanom
NPpc

Selected principal components
PCR_reconstruction

Principal Component Regression Reconstruction
inv_boxcox

Inverse Box-Cox transform
make_Z

Make cross-validation folds.
metrics_with_transform

Transform the estimates before calculating metrics
propagate

State propagation
RE

Reduction of Error
penalized_likelihood

Penalized likelihood objective function
vec_to_list

Converts theta from a vector (as used in GA) to list (as used in Kalman smoothing)
ldsr

ldsr: Linear Dynamical System Reconstruction
theta

LDS parameters