| .rss_gau | R Documentation |
For time point i, regress Y_i on its p_i predecessors (Y_(i-1), ..., Y_(i-p_i)) and return the residual sum of squares.
.rss_gau(y, i, p, mu = NULL, include_intercept = TRUE)
y |
Numeric matrix n_subjects by n_time. |
i |
Time index (1-based). |
p |
Number of predecessors to include in regression (can be 0). |
mu |
Optional mean vector. If provided, data is centered by mu before regression. If NULL, regression includes an intercept. |
include_intercept |
Logical. If TRUE and mu is NULL, include intercept in regression. |
When mu is provided, the regression is:
(Y_i - mu_i) ~ (Y_(i-1) - mu_(i-1)) + ... + (Y_(i-p) - mu_(i-p))
with no intercept.
When mu is NULL and include_intercept is TRUE:
Y_i ~ 1 + Y_(i-1) + ... + Y_(i-p)
For i = 1 or p = 0, the RSS is simply the sum of squared deviations from the mean (or from mu_1 if provided).
Residual sum of squares (scalar).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.