one_LDS_rep: One LDS replicate

Description Usage Arguments Value Examples

View source: R/stochastics.R

Description

Generate a single stochastic time series from an LDS model

Usage

1
2
3
4
5
6
7
8
9
one_LDS_rep(
  rep.num,
  theta,
  u = NULL,
  v = NULL,
  years,
  mu = 0,
  exp.trans = TRUE
)

Arguments

rep.num

The ID number of the replicate

theta

A list of parameters: A, B, C, D, Q, R, x0, v0

u

Input matrix for the state equation (m_u rows, T columns)

v

Input matrix for the output equation (m_v rows, T columns)

years

The years of the study horizon

mu

Mean of the log-transformed streamflow process

exp.trans

Whether exponential transformation back to the streamflow space is required. If TRUE, both Y and Q are returned, otherwise only Y.

Value

A data.table. The first column is the years of the study horizon, as supplied by year. Subsequent columns are simX, simY, and simQ which are the simulated catchment state (X), log-transformed and centralized flow (Y) and flow (Q). The last column is the replicate ID number.

Examples

1
2
# Learn theta
one_LDS_rep(1, theta, t(NPpc), t(NPpc), 1200:2012, mu = mean(log(NPannual$Qa)))

ldsr documentation built on May 4, 2020, 5:06 p.m.