Description Usage Arguments Value Examples
View source: R/LDS_reconstruction.R
The initial conditions can either be randomized (specifiled by num.restarts) or provided beforehand.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18  | 
Qa | 
 Observations: a data.frame of annual streamflow with at least two columns: year and Qa.  | 
u | 
 Input matrix for a single-model reconstruction, or a list of input matrices for an ensemble reconstruction.  | 
v | 
 Same as u.  | 
start.year | 
 Starting year of the climate proxies, i.e, the first year of the paleo period.   | 
method | 
 By default this is "EM". There are experimental methods but you should not try.  | 
transform | 
 Flow transformation, either "log", "boxcox" or "none". Note that if the Box-Cox transform is used, the confidence interval after back-transformation is simply the back-transform of the trained onfidence interval; this is hackish and not entirely accurate.  | 
init | 
 A list, each element is a vector of initial values for the parameters. If   | 
num.restarts | 
 The number of initial conditions to start the EM search; ignored if   | 
return.init | 
 If   | 
ub | 
 Upper bounds, a vector whose length is the number of parameters  | 
lb | 
 Lower bounds  | 
num.islands | 
 Number of islands (if method is GA; experimental)  | 
pop.per.island | 
 Initial population per island (if method is GA; experimental)  | 
niter | 
 Maximum number of iterations, default 1000  | 
tol | 
 Tolerance for likelihood convergence, default 1e-5. Note that the log-likelihood is normalized by dividing by the number of observations.  | 
return.raw | 
 If TRUE, state and streamflow estimates without measurement updates will be returned.  | 
A list of the following elements
rec: reconstruction results, a data.table with the following columns
year: calculated from Qa and the length of u
X: the estimated hidden state
Xl, Xu: lower and upper range for the 95\
Q: the reconstructed streamflow
Ql, Qu: lower and upper range for the 95\
theta: model parameters
lik: maximum likelihood
 init: the initial condition that resulted in the maximum likelihood (if return.init = TRUE).
1 2 3 4 5 6  | # Make a shorter time horizon so that this example runs fast
u <- v <- t(NPpc[601:813])
# We run this example without parallelism
foreach::registerDoSEQ()
LDS_reconstruction(NPannual, u, v, start.year = 1800, num.restarts = 1)
# Please refer to the vignette for the full run with parallel options. It takes a second or two.
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.