Skip to content

Commit 2f13d57

Browse files
committed
geo-spattime >> pkgs, minor edits
1 parent 1a0c5e8 commit 2f13d57

File tree

4 files changed

+42
-10
lines changed

4 files changed

+42
-10
lines changed

qmd/diagnostics-probabilistic.qmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
- [{]{style="color: #990000"}[topmodels](https://topmodels.r-forge.r-project.org/){style="color: #990000"}[}]{style="color: #990000"} currently supported models:
2222

23-
- `lm`, `glm`, `glm.nb`, `hurdle`, `zeroinfl`, `zerotrunc`, `crch`, `disttree`, and models from [{disttree}]{style="color: #990000"}, [{crch}]{style="color: #990000"}
23+
- `lm`, `glm`, `glm.nb`, `gamlss``bamlss``hurdle`, `zeroinfl`, `zerotrunc`, `crch`, `betareg`, and models from [{disttree}]{style="color: #990000"}, [{crch}]{style="color: #990000"}
2424
- Also see video, [Probability Distribution Forecasts: Learning from Random Forests and Graphical Assessment](https://www.youtube.com/watch?v=iMBgmfdKs8g)
2525

2626
- `autoplot` produces a ggplot object that can be used for further customization

qmd/geospatial-modeling.qmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@
189189
- Packages
190190
- [{]{style="color: #990000"}[BMEmapping](https://cran.r-project.org/web/packages/BMEmapping/index.html){style="color: #990000"}[}]{style="color: #990000"} - Spatial Interpolation using **Bayesian Maximum Entropy (BME)**
191191
- Ssupports optimal estimation using both precise (hard) and uncertain (soft) data, such as intervals or probability distributions
192-
- [{]{style="color: #990000"}[gstat](https://cran.r-project.org/web/packages/gstat/index.html){style="color: #990000"}[}]{style="color: #990000"} - **OG**; Has various interpolation methods.
192+
- [{]{style="color: #990000"}[gstat](https://cran.r-project.org/web/packages/gstat/index.html){style="color: #990000"}[}]{style="color: #990000"} - **OG**; Has idw and various kriging methods.
193193
- [{]{style="color: #990000"}[intamap](https://cran.r-project.org/web/packages/intamap/index.html){style="color: #990000"}[}]{style="color: #990000"} ([Paper](https://www.sciencedirect.com/science/article/abs/pii/S0098300410002190?via%3Dihub)) - Procedures for **Automated Interpolation** (Edzer Pebesma et al)
194194
- One needs to choose a model of spatial variability before one can interpolate, and experts disagree on which models are most useful.
195195
- [{]{style="color: #990000"}[interpolateR](https://cran.r-project.org/web/packages/InterpolateR/index.html){style="color: #990000"}[}]{style="color: #990000"} - Includes a range of methods, from traditional techniques to advanced **machine learning** approaches

qmd/geospatial-spat-temp.qmd

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,18 @@
33
## Misc {#sec-geo-sptemp-misc .unnumbered}
44

55
- 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.
68
- [{]{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
79
- Has **datatable** under the hood, so it should be pretty fast for larger data
810
- **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
1018
- [{]{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.
1119
- Currently, it supports point-referenced Gaussian, Poisson, binomial and binary outcomes.
1220
- Highly parallelizable and hence, much faster than traditional Markov chain Monte Carlo algorithms while delivering competitive predictive performance
@@ -15,11 +23,13 @@
1523
- 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
1624
- Depends on [{spacetime}]{style="color: #990000"} and [{sp}]{style="color: #990000"}
1725
- [{]{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
1827
- 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"}.
1928
- Resources
2029
- [SDS, Ch.13](https://r-spatial.org/book/13-Geostatistics.html)
2130
- [Geodata and Spatial Regression, Ch. 14](https://ruettenauer.github.io/Geodata_Spatial_Regression/09_spatiotemporal.html)
2231
- [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)
2333
- Papers
2434
- [INLA-RF: A Hybrid Modeling Strategy for Spatio-Temporal Environmental Data](https://arxiv.org/abs/2507.18488)
2535
- Integrates a statistical spatio-temporal model with RF in an iterative two-stage framework.
@@ -89,7 +99,7 @@
8999
- Points: Data having points support should use the SpatialPoints class for the spatial feature
90100
- Polygons: Values reflect aggregates (e.g., sums, or averages) over the polygon (SpatialPolygonsDataFrame, SpatialPolygons)
91101
- 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."
93103
- [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.
94104
- [Example]{.ribbon-highlight}: Private capital stock (?)
95105

@@ -105,7 +115,7 @@
105115
- Each row is a single time unit and space unit combination.
106116
- 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)
107117

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)
109119

110120
::: panel-tabset
111121
## Input Data
@@ -151,9 +161,9 @@
151161

152162
``` r
153163
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)
157167

158168
length(st_data)
159169
#> [1] 816
@@ -183,6 +193,10 @@
183193
```
184194

185195
- 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
186200
- Converting back to a dataframe adds 6 new columns to [df_data]{.var-text}:
187201
- [V1]{.var-text}, [V2]{.var-text}: Latitude, Longitude
188202
- [sp.ID]{.var-text}: IDs within the spatial geomtry object (geom_states)
@@ -237,7 +251,7 @@
237251
238252
- See Long \>\> Example \>\> Create full grid spacetime object for a more detailed breakdown of creating these objects
239253
- **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.
241255
242256
## STFDF Object
243257
@@ -279,7 +293,7 @@
279293
#> 78888 605634.5 6136859 12 1978-12-31 12:00:00 1979-01-01 12:00:00 6574 1.0835638
280294
```
281295
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}.
283297
- [interval = TRUE]{.arg-text}, since the values are daily mean wind speed (aggregation)
284298
- See Time and Movement section
285299
- [df_st_wind]{.var-text} is in long format

scrapsheet.qmd

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,24 @@ title: "Scrapsheet"
5252
6. Calculate CI variant on the distribution of averaged scores
5353
- Questions
5454
- How many bootstrap iterations?
55+
- Empirical Orthogonal Functions (EOFs)
56+
- A form of PCA applied to spatiotemporal data that is useful for understanding patterns in fields like climate science, oceanography, and meteorology.
57+
58+
- Components
59+
60+
- Spatial Patterns (EOFs) - Shows where *variability* is concentrated
61+
62+
<!-- -->
63+
64+
- Time series (principal components) - Shows when each pattern is *active* and with what *amplitude*
65+
66+
- Process
67+
68+
- Locations are variables and observations are time series
69+
- Preprocess (scale) and perform PCA
70+
- Each EOF is an eigenvector ($V$) representing a spatial pattern, and its eigenvalue tells you how much variance that pattern explains. The PC is a time series ($\text{PC1}_i = V_{(,1)} \cdot A_{(i,)}$)
71+
72+
- Example: In sea surface temperature data, EOF1 might reveal the El Niño/La Niña pattern - showing warming/cooling in the tropical Pacific. The associated PC would be a time series showing El Niño events as positive peaks and La Niña as negative troughs.
5573

5674
## Multivariable Geostatistics
5775

0 commit comments

Comments
 (0)