Description Usage Arguments Value Author(s) See Also Examples
Expands the temporal trends in F to a full matrix (with lots of zeros). Mainly used for testing, and illustration in examples.
1 |
F |
A (number of obs.) - by - (number of temporal trends) matrix
containing the temporal trends. Usually |
loc.ind |
A vector indicating which location each row in |
n.loc |
Number of locations. |
sparse |
Should the returned matrix be sparse (uses the Matrix-package,
see |
Returns the expanded F, a dim(F)[1]
-by-n.loc*dim(F)[2]
matrix
Johan Lindstrom and Adam Szpiro
Other temporal trend functions: calc.FXtF2
,
calc.FX
, calc.tFXF
,
calc.tFX
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ##create a trend
trend <- cbind(1:5,sin(1:5))
##an index of locations
idx <- c(rep(1:3,3),1:2,2:3)
##a list of time points for each location/observation
T <- c(rep(1:3,each=3),4,4,5,5)
##expand the F matrix to match the locations/times in idx/T.
F <- trend[T,]
##compute the expanded matrix
expandF(F, idx)
##compute the expanded matrix, assuming additional locations
expandF(F, idx, 5)
##or as a full matrix
expandF(F, idx, 5, sparse=FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.