|
3 | 3 | ## Misc {#sec-geo-sptemp-misc .unnumbered} |
4 | 4 |
|
5 | 5 | - Packages |
| 6 | + - [{]{style="color: #990000"}[cubble](https://huizezhang-sherry.github.io/cubble/){style="color: #990000"}[}]{style="color: #990000"} ([Vignette](https://www.jstatsoft.org/article/view/v110i07)) - **Organizing** and **wrangling** space-time data. Addresses data collected at unique fixed locations with irregularity in the temporal dimension |
| 7 | + - Handles **sparse grids** by nesting the time series features in a tibble or tsibble. |
6 | 8 | - [{]{style="color: #990000"}[magclass](https://cran.r-project.org/web/packages/magclass/index.html){style="color: #990000"}[}]{style="color: #990000"} - Data Class and Tools for Handling Spatial-Temporal Data |
7 | 9 | - Has **datatable** under the hood, so it should be pretty fast for larger data |
8 | 10 | - **Conversions, basic calculations and basic data manipulation** |
9 | | - - [{]{style="color: #990000"}[mlr3spatiotempcv](https://mlr3spatiotempcv.mlr-org.com/){style="color: #990000"}[}]{style="color: #990000"} - Extends the **mlr3** machine learning framework with **spatio-temporal resampling methods** to account for the presence of spatiotemporal autocorrelation (STAC) in predictor variables |
| 11 | + - [{]{style="color: #990000"}[mlr3spatiotempcv](https://mlr3spatiotempcv.mlr-org.com/){style="color: #990000"}[}]{style="color: #990000"} - Extends the **mlr3** machine learning framework with spatio-temporal **resampling methods** to account for the presence of spatiotemporal autocorrelation (STAC) in predictor variables |
| 12 | + - [{]{style="color: #990000"}[rasterVis](https://oscarperpinan.github.io/rastervis/){style="color: #990000"}[}]{style="color: #990000"} - Provides three methods to **visualize** spatiotemporal rasters: |
| 13 | + - `hovmoller` produces Hovmöller diagrams |
| 14 | + - `horizonplot` creates horizon graphs, with many time series displayed in parallel |
| 15 | + - `xyplot` displays conventional time series plots extracted from a multilayer raster. |
| 16 | + - [{]{style="color: #990000"}[sdmTMB](https://sdmtmb.github.io/sdmTMB/){style="color: #990000"}[}]{style="color: #990000"} - Implements spatial and spatiotemporal **GLMMs** (Generalized Linear Mixed Effect Models) |
| 17 | + - [{]{style="color: #990000"}[sftime](https://r-spatial.github.io/sftime/){style="color: #990000"}[}]{style="color: #990000"} - A complement to [{stars}]{style="color: #990000"}; provides a generic data format which can also handle **irregular (grid)** spatiotemporal data |
10 | 18 | - [{]{style="color: #990000"}[spStack](https://span-18.github.io/spStack-dev/){style="color: #990000"}[}]{style="color: #990000"} - Bayesian inference for point-referenced spatial data by assimilating posterior inference over a collection of candidate models using stacking of predictive densities. |
11 | 19 | - Currently, it supports point-referenced Gaussian, Poisson, binomial and binary outcomes. |
12 | 20 | - Highly parallelizable and hence, much faster than traditional Markov chain Monte Carlo algorithms while delivering competitive predictive performance |
|
15 | 23 | - Models: Bayesian Gaussian Process (GP) Models, Bayesian Auto-Regressive (AR) Models, and Bayesian Gaussian Predictive Processes (GPP) based AR Models for spatio-temporal big-n problems |
16 | 24 | - Depends on [{spacetime}]{style="color: #990000"} and [{sp}]{style="color: #990000"} |
17 | 25 | - [{]{style="color: #990000"}[stars](https://r-spatial.github.io/stars/){style="color: #990000"}[}]{style="color: #990000"} - **Reading, manipulating, writing and plotting** spatiotemporal arrays (raster and vector data cubes) in 'R', using 'GDAL' bindings provided by 'sf', and 'NetCDF' bindings by 'ncmeta' and 'RNetCDF' |
| 26 | + - Only handles **full lattice/grid** data |
18 | 27 | - It supercedes the [{]{style="color: #990000"}[spacetime](https://cran.r-project.org/web/packages/spacetime/index.html){style="color: #990000"}[}]{style="color: #990000"}, which extended the shared classes defined in [{sp}]{style="color: #990000"} for spatio-temporal data. [{stars}]{style="color: #990000"} uses PROJ and GDAL through [{sf}]{style="color: #990000"}. |
19 | 28 | - Resources |
20 | 29 | - [SDS, Ch.13](https://r-spatial.org/book/13-Geostatistics.html) |
21 | 30 | - [Geodata and Spatial Regression, Ch. 14](https://ruettenauer.github.io/Geodata_Spatial_Regression/09_spatiotemporal.html) |
22 | 31 | - [Spatial Modelling for Data Scientists, Ch. 10](https://gdsl-ul.github.io/san/10-st_analysis.html) |
| 32 | + - Spatio-Temporal Statistics in R (See R \>\> Documents \>\> Geospatial) |
23 | 33 | - Papers |
24 | 34 | - [INLA-RF: A Hybrid Modeling Strategy for Spatio-Temporal Environmental Data](https://arxiv.org/abs/2507.18488) |
25 | 35 | - Integrates a statistical spatio-temporal model with RF in an iterative two-stage framework. |
|
89 | 99 | - Points: Data having points support should use the SpatialPoints class for the spatial feature |
90 | 100 | - Polygons: Values reflect aggregates (e.g., sums, or averages) over the polygon (SpatialPolygonsDataFrame, SpatialPolygons) |
91 | 101 | - Grids: Values can be point data or aggregates over the cell. |
92 | | - - `stConstruct` creates "an [STFDF]{.arg-text} object if all space and time combinations occur only once, or else an object of class [STIDF]{.arg-text}, which might be coerced into other representations." |
| 102 | + - `stConstruct` creates "a [STFDF]{.arg-text} (full lattice/full grid) object if all space and time combinations occur only once, or else an object of class [STIDF]{.arg-text} (irregular grid), which might be coerced into other representations." |
93 | 103 | - [Long]{.underline} - The full spatio-temporal information (i.e. response value) is held in a single column, and location and time are also single columns. |
94 | 104 | - [Example]{.ribbon-highlight}: Private capital stock (?) |
95 | 105 |
|
|
105 | 115 | - Each row is a single time unit and space unit combination. |
106 | 116 | - This is likely not the row order you want though. I think these spatio-temporal object creation functions want ordered by time, then by space. (See Example) |
107 | 117 |
|
108 | | - - [Example]{.ribbon-highlight}: Create full grid spacetime object from a long table (7.2 Panel Data in [{spacetime}]{style="#990000"} vignette) |
| 118 | + - [Example]{.ribbon-highlight}: Create full grid spacetime object from a long table (7.2 Panel Data in [{spacetime}]{style="color: #990000"} vignette) |
109 | 119 |
|
110 | 120 | ::: panel-tabset |
111 | 121 | ## Input Data |
|
151 | 161 |
|
152 | 162 | ``` r |
153 | 163 | st_data <- |
154 | | - STFDF(geom_states, |
155 | | - vec_time, |
156 | | - df_data) |
| 164 | + STFDF(sp = geom_states, |
| 165 | + time = vec_time, |
| 166 | + data = df_data) |
157 | 167 |
|
158 | 168 | length(st_data) |
159 | 169 | #> [1] 816 |
|
183 | 193 | ``` |
184 | 194 |
|
185 | 195 | - So combining of these objects into a spacetime object doesn't seemed be based any names (e.g. a joining variable) of the elements of these separate objects. |
| 196 | + - STFDF arguments: |
| 197 | + - [sp]{.arg-text}: An object of class [Spatial]{.arg-text}, having n elements |
| 198 | + - [time]{.arg-text}: An object holding time information, of length m; |
| 199 | + - [data]{.arg-text}: A data frame with n\*m rows corresponding to the observations |
186 | 200 | - Converting back to a dataframe adds 6 new columns to [df_data]{.var-text}: |
187 | 201 | - [V1]{.var-text}, [V2]{.var-text}: Latitude, Longitude |
188 | 202 | - [sp.ID]{.var-text}: IDs within the spatial geomtry object (geom_states) |
|
237 | 251 |
|
238 | 252 | - See Long \>\> Example \>\> Create full grid spacetime object for a more detailed breakdown of creating these objects |
239 | 253 | - **The order of station geometries in [geom_stations]{.var-text} should match the order of the columns in [mat_wind_velos]{.var-text}** |
240 | | - - In the vignette, the data used to create the geometry object is ordered according to the matrix using `match`. See [R, Base R \>\> Functions](r-base-r.qmd#sec-r-baser-funs){style="color: green"} \>\> `match` |
| 254 | + - In the vignette, the data used to create the geometry object is ordered according to the matrix using `match`. See [R, Base R \>\> Functions](r-base-r.qmd#sec-r-baser-funs){style="color: green"} \>\> `match` for the code. |
241 | 255 |
|
242 | 256 | ## STFDF Object |
243 | 257 |
|
|
279 | 293 | #> 78888 605634.5 6136859 12 1978-12-31 12:00:00 1979-01-01 12:00:00 6574 1.0835638 |
280 | 294 | ``` |
281 | 295 |
|
282 | | - - [space]{.arg-text} has a confusing description. Here it's just a numerical index for the number of columns of [mat_wind_velos]{.var-text} or the geometries in [geom_stations]{.var-text} |
| 296 | + - [space]{.arg-text} has a confusing description. Here it's just a numerical index for the number of columns of [mat_wind_velos]{.var-text} which would match an index/order for the geometries in [geom_stations]{.var-text}. |
283 | 297 | - [interval = TRUE]{.arg-text}, since the values are daily mean wind speed (aggregation) |
284 | 298 | - See Time and Movement section |
285 | 299 | - [df_st_wind]{.var-text} is in long format |
|
0 commit comments