y.present: Generate linear time lagged response with time series...

Description Usage Arguments Details Value Examples

View source: R/Ypresent.R

Description

The response (univariate) is generated by the formula

y^{(t)} = X^{(t)}β^{(0)} + X^{(t-1)}β^{(1)} + ... + ε_t

where each X is a vector of covariates at a certain time point, with corresponding regression coefficients. Also automatically prepares the necessary lagged response matrix for second step (residual fitting)

Usage

1
y.present(beta, sigmay, X, lagx, lagy)

Arguments

beta

a list. Default number of list is 5, corresponding to the furthest lag x^{t-4}. Each list is a vector of regression coefficients, corresponding to all covariates at that time stamp.

sigmay

a number. Standard deviation of noise for response.

X

a matrix. Covariate matrix, each column being one x. This corresponds to the output X from XgenSimple, XgenCorrs.

lagx

a number. Number of lags for covarites, default is 5, meaning that the furthest covariate is x^{(t-4)}.

lagy

a number. Number of lags for response for the preparation of second step regression, default is 5, meaning that the furthest response is y^{(t-5)}.

Details

The most recent time stamp for covariates is t, the same as the response.

The input matrix X is automatically shifted given the number of lags. Due to the shifting scheme for the time lags, the length of the output response and extended matrix (nrow) are (t - lagx).

Value

a list of components

X

a matrix. The original input matrix X

Y

a vector. The generated linear time lagged response

ExtendX

a matrix. Dimension is (t - lagx) by lagx*length(beta), 495 by 50 in our examples

ExtendY

a matrix. Dimension is (t - lagy) by lagy

Examples

1
# see

yymmhaha/PackPaper1 documentation built on May 24, 2019, 8:55 a.m.