Description Usage Arguments Value See Also Examples
View source: R/unload.Hst.ls.R
Convert a spacio-temporal covariate into contemporaneous data
1 | unload.Hst.ls(Hst.ls, which.col, rgr.lags)
|
Hst.ls |
Space-time covariates. A list of length τ, each element should be a n x p_st numeric matrix. |
which.col |
Which column of |
rgr.lags |
Temporal lagging of |
A numeric τ x n matrix.
load.Hst.ls.Z
, load.Hst.ls.2Zs
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
###### here's an itty-bitty example
tau <- 7
n <- 5
Hst.ls <- list()
for(i in 1:tau) { Hst.ls[[i]] <- matrix(rnorm(n*4), nrow=n) }
Zh <- unload.Hst.ls(Hst.ls, 1, 0)
## The function is currently defined as
function (Hst.ls, which.col, rgr.lags)
{
n <- nrow(Hst.ls[[1]])
tau <- length(Hst.ls)
Z.out <- matrix(NA, tau, n)
min.ndx <- max(1, -min(rgr.lags) + 1)
max.ndx <- min(tau, tau - max(rgr.lags))
for (i in min.ndx:max.ndx) {
Z.out[i - rgr.lags, ] <- Hst.ls[[i]][, which.col]
}
return(Z.out)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.