20250812 meeting
Introduction
Due to the combined effects of human activities and natural climate variability (e.g., El Niño), global surface temperatures have shown a long-term upward trend. While satellite remote sensing data (such as GES DISC’s MERRA-2 tavg1_2d_flx_Nx) can provide high-frequency global surface temperature observations, they are still affected by factors such as satellite scanning intervals, cloud cover, instrument failures, and data transmission errors, often resulting in missing data or anomalies.
To establish a reliable spatiotemporal temperature field that can support policy-making and scientific research, this study designs a rigorous simulation experiment to compare three time series forecasting methods, SSSD, TSMixer, and RegressionEnsemble, combined with autoFRK for spatial interpolation and prediction, evaluating the differences in performance for data imputation and forecasting.
Research Motivation
The continuous rise in global surface temperatures has become a core issue in climate change research and policy-making. High-resolution and high-temporal-frequency global temperature data are crucial for real-time monitoring of extreme climate events, assessing climate model accuracy, and formulating mitigation and adaptation strategies. However, in practical applications, satellite remote sensing data often suffer from incompleteness or distortion due to observational limitations and technical issues. If left unprocessed, this can affect the reliability of reconstructed temperature fields and future trend forecasts. While existing time series and spatial interpolation methods each have their strengths, there is still a lack of systematic comparative studies on their performance for large-scale spatiotemporal data imputation and forecasting. Therefore, this study aims to conduct a rigorous simulation experiment to assess the applicability and performance differences of various methods in reconstructing global surface temperature data, providing technical references for future climate monitoring and decision-making.
Research Methods
This study is based on the MERRA-2 tavg1_2d_flx_Nx dataset provided by GES DISC, selecting the region with longitude $73^\circ \sim 104^\circ$ and latitude $36^\circ \sim 54^\circ$ as the study area. This area covers northwestern China, western Mongolia, and parts of Kazakhstan, Kyrgyzstan, and Uzbekistan, featuring diverse terrain such as mountains, plateaus, basins, grasslands, lakes, and rivers. The diversity of geographic and climatic conditions results in different yet correlated temperature variation patterns across observation points, serving as the basis for multivariate model inputs. As the study focuses on a relatively small spatiotemporal range, it allows for controlling data heterogeneity while improving model prediction accuracy.
Data Preprocessing
Data Extraction and Merging
- Download the complete 2024 MERRA-2 tavg1_2d_flx_Nx dataset.
- Merge hourly observation data in chronological order and check the integrity and consistency of time stamps.
Missing Value and Outlier Detection
- Detect missing or anomalous values in the raw data.
Data Reshaping
- Reshape the global dataset into a 3D array of $(24\ \text{hours},\ 366\ \text{days},\ 207{,}936\ \text{locations})$.
Experimental Subset Selection
- Extract the target region (longitude $73^\circ \sim 104^\circ$, latitude $36^\circ \sim 54^\circ$) from the global dataset.
- Select $(24\ \text{hours},\ 260\ \text{days},\ 1{,}850\ \text{locations})$ as the experimental sample.
Defining Known and Unknown Regions
- Set a fixed pseudo-random seed (seed = 123) to ensure experiment reproducibility.
- Randomly select 1,500 locations ($\approx$ 81.5%) from the 1,850 locations in the target area as known locations, used for comparing future trend forecasts.
- Assign the remaining 350 locations ($\approx$ 19.5%) as unknown locations, used for evaluating past spatial imputation performance and future trend forecasts.
The code used is as follows:
| |
Next, we will generate time series forecasts using the following different models and perform the following operations:
Time Series Forecasting
- Train using the time series data from the known locations with different models.
- Predict the future 10 days for the known locations, i.e., $24 \times 10 = 240$ time steps.
- The shape of each prediction is $(24, 10, 1850)$.
Spatial Imputation
- Train the autoFRK model using the time series data and coordinates of the known locations, including the future information predicted by the other models.
- Impute the full time series values for the unknown locations.
SSSD
SSSD (Structured State Space Diffusion) is a generative time series imputation and forecasting method that combines a conditional diffusion model with a structured state space sequence model (S4). The S4 layers effectively capture long-term dependencies, while the diffusion mechanism enhances the flexibility and expressiveness of imputation, achieving excellent performance in both missing data completion and future trend simulation.
In the diffusion generation mechanism, the imputation task for missing data is formulated as a reverse diffusion process, gradually restoring missing regions from noise. It can handle complex scenarios such as random missing (RM), non-random missing (NRM), and even long blackout missing (BM).
The S4 model is a structured state space model that uses HiPPO theory to initialize the state matrix, enabling efficient and stable capture of long-term structural relationships in time series, thus improving SSSD’s ability to model long-term dependencies and cross-variable correlations.
The SSSD model can handle various types of missing data and forecasting tasks, including:
Random Missing (RM) Missing points are randomly distributed across multiple time series, with independent missing locations, often used to simulate missing data caused by sporadic observation errors or data transmission failures.
Random Block Missing (RBM) Missing blocks of random length and position occur in each time series. This can be viewed as a high-dimensional version of non-random missing in a single time series, common in cases such as brief instrument failures or local obstructions.
Blackout Missing (BM) Similar to random block missing, but all time series have missing data in the same time interval, representing a synchronous missing pattern, often caused by large-scale systematic failures such as satellite outages or data server interruptions.
Time-Series Forecasting (TF) Similar to blackout missing, but the missing segment is at the end of all time series, corresponding to future periods without observations, used to evaluate the model’s ability to forecast future trends.

Because SSSD requires three-dimensional inputs, here the adjusted dataset shape is $(24, 250, 1850)$. Based on prior experience, using 24-hour data as variables performs significantly better than using 1,850 locations as variables. Therefore, the input shape of the dataset here is adjusted to $(1,850 \text{ locations}, 260 \text{ days}, 24 \text{ hours})$ to achieve more accurate experimental results.
The following are the parameter settings for the SSSD model:
Model configuration
model.yamlIn the model settings, bothinput_channelsandoutput_channelsare set to 24, representing 24-dimensional features per input and output (hourly temperatures for 24 hours). The WaveNet part uses 32 residual layers (residual_layers: 32), each with 64 residual channels, and employs skip connections to aggregate outputs from different layers, enhancing multi-scale feature integration.For the diffusion model, 200 diffusion steps are set (
T: 200), with $\beta$ values linearly increasing from 0.0001 to 0.02, controlling the strength of noise addition and removal.The S4 model’s maximum sequence length is set to 250 (
s4_max_sequence_length), matching the length of the time series in the dataset, representing 250 days; the state dimension is 64 (s4_state_dim), and both bidirectional computation (s4_bidirectional) and layer normalization (s4_use_layer_norm) are enabled to ensure stability and generalization.
| |
Model Training Configuration
training.yamlIn the training settings, the batch size (
batch_size) is set to 300. Since there are 1,500 known locations in the training data, each iteration is divided into $1500 \div 300 = 5$ batches to ensure that each iteration covers the entire training set. The maximum number of iterations (n_iters) is set to 3,800, and the learning rate (learning_rate) is 0.0005.The training strategy uses only generating missing values (
only_generate_missing: true), and applies a time series forecasting missing mask (masking: "forecast"), which treats the end of the sequence as unknown for prediction. The length of each masked segment (missing_k) is 10.
| |
Model Imputation Configuration
inference.yamlThe inference settings are similar to the training configuration, with a batch size of 300 (
batch_size), and the model is loaded from the best checkpoint path (ckpt_path) saved during training. The number of inference repetitions (trials) is set to 1, and each time generation is performed only on the missing parts. The missing mask strategy and length remain consistent with training to ensure uniformity.
| |
TSMixer
Unlike deep generative models like SSSD, TSMixer (Time-Series Mixer) is a time series forecasting model based on a multilayer perceptron (MLP) architecture, designed to efficiently capture temporal and feature dimension correlations within time series for multivariate forecasting. TSMixer models time series data through stacked MLP mixer layers that alternate fusion along the time and feature dimensions.
The core of TSMixer consists of multiple mixer layers, each first mixing along the time dimension and then along the feature dimension. This enables the model to effectively capture temporal dependencies and feature correlations within the time series. The entire model is composed solely of MLPs, avoiding computational bottlenecks present in RNNs or attention mechanisms, thereby improving training efficiency and prediction speed.
Additionally, TSMixer supports various types of auxiliary variables, including past covariates, future covariates, and static covariates, providing high flexibility for multivariate and complex forecasting tasks. In several long-term forecasting benchmarks, TSMixer outperforms traditional Transformer-based models in both computational efficiency and accuracy.
TSMixer is suitable for:
Multivariate time series forecasting Able to handle correlations among multiple variables, applicable to fields such as weather forecasting and financial market analysis.
Long-term forecasting tasks Provides stable and accurate predictions in long-term forecasts.
Resource-constrained environments Due to its efficient computational performance, TSMixer is well-suited for scenarios with limited computing resources.
Below, we use the PyTorch-based darts module’s TSMixerModel to train and forecast multivariate time series on a daily (24-hour) basis.
In this code, input_chunk_length=30 means the model observes the past 30 days of data, while output_chunk_length=10 predicts the next 10 days. The training runs for 3,800 iterations.
| |
RegressionEnsemble
RegressionEnsemble is an ensemble forecasting model in the darts module that uses regression models (such as linear regression) to combine outputs from multiple base forecasting models, improving overall prediction accuracy. This model employs a stacking technique, using the predictions from multiple base models as features, and trains a regression model to learn the optimal fusion weights.
The model can simultaneously forecast multiple variables and integrate various auxiliary information, including past known variables, future known variables, and static covariates, enhancing prediction accuracy. RegressionEnsemble is suitable for:
Multivariate time series forecasting Effectively combines predictions from different models when forecasting multiple variables simultaneously.
Long-term forecasting tasks Improves prediction stability and accuracy by aggregating multiple model results.
Resource-constrained environments Due to the computational efficiency of regression fusion, it is particularly suitable for environments with limited computing resources.
Below, we use the PyTorch-based darts module’s RegressionEnsembleModel to train and forecast multivariate time series on a daily (24-hour) basis.
In this code, three base forecasting models are used to build the regression ensemble model. First, NaiveSeasonal(K=7) is a simple seasonal model based on the assumption that the time series exhibits similar patterns every 7 days. Second, LinearRegressionModel(lags=30) is a linear regression model using data from the past 30 time points as features to capture trends and changes in the time series. Lastly, the NaiveDrift() model predicts simple trends based on the overall drift of the sequence.
The predictions from these three base models are used as input features for the regression ensemble to learn how to optimally combine them, enhancing overall forecast accuracy. The parameter regression_train_n_points=30 specifies that the fusion model uses predictions from the past 30 time points to train the regression model, enabling it to more effectively capture temporal patterns and generate accurate forecasts.
| |
autoFRK
autoFRK (Automatic Fixed Rank Kriging) is an efficient spatial interpolation and forecasting method based on spatial statistical theory. It combines the dimension reduction technique of fixed rank kriging (FRK), using multi-scale basis functions to capture different spatial variation features in data, and automatically selects model parameters.
Mathematically, the autoFRK model can be expressed as:
$$ z[t] = \mu + G \cdot w[t] + \eta[t] + e[t], \quad w[t] \sim N(0, M), \quad e[t] \sim N(0, s \cdot D); \quad t = 1, \cdots, T, $$
where $z[t]$ is the observed (partial) data vector at $n$ locations; $\mu$ is a constant mean vector of length $n$; $D$ is a known $n \times n$ matrix; $G$ is a known $n \times K$ matrix; $\eta[t]$ is a random vector of length $n$ corresponding to a spatially stationary process; and $w[t]$ is an unobserved random weight vector of length $K$.
Parameters are estimated via maximum likelihood with closed-form expressions. The basis function matrix $G$ is constructed using ordered thin-plate spline functions, and the number of bases is selected by Akaike’s information criterion (AIC).
autoFRK represents the spatial random field via basis functions $G$, compressing high-dimensional spatial data into a low-dimensional coefficient space, greatly reducing computational complexity. It is especially suitable for large-scale spatial data analysis. By maximizing the likelihood function, autoFRK effectively captures spatial structure and provides accurate spatial predictions along with uncertainty quantification.
In this study, autoFRK is used to perform spatial interpolation and imputation on temporal prediction results generated by time series models (such as SSSD, TSMixer, RegressionEnsemble). This spatiotemporal integration helps fill data gaps and enhances the completeness and accuracy of global surface temperature monitoring.
The application procedure of autoFRK in this study is as follows:
- Input the point-wise temporal predictions generated by time series models.
- Perform spatial basis function expansion and parameter estimation via
autoFRK. - Conduct spatial interpolation and prediction for unknown locations to fill missing data areas.
- Combine temporal and spatial prediction results to provide a complete global surface temperature spatiotemporal field.
The code for spatial imputation is as follows:
| |
Experimental Results
In the experiments above, except for the RegressionEnsemble model, all models were trained for 3,800 iterations. The data format for all three models was the same; however, since TSMixer and RegressionEnsemble only accept two-dimensional data as input, training and forecasting were performed using a loop.
SSSD + autoFRK
For conclusions, please refer to the section 20250731 meeting Experiment 3.
TSMixer + autoFRK
For conclusions, please refer to the section 20250808 meeting TSMixerModel + autoFRK.
RegressionEnsemble + autoFRK
For conclusions, please refer to the section 20250808 meeting RegressionEnsembleModel + autoFRK.
Conclusion
| Metrics / Models | SSSD + autoFRK | TSMixer + autoFRK | RegressionEnsemble + autoFRK |
|---|---|---|---|
| MSPE (ALL Locs & Future) | 24.97269111 | 75.99501027 | 33.41590875 |
| MSPE (Known Locs & Future) | 24.97548082 | 76.24826754 | 33.23029709 |
| MSPE (Unknown Locs & Future) | 24.96073520 | 74.90962190 | 34.21138730 |
| RMSPE (ALL Locs & Future) | 4.99726836 | 8.71751170 | 5.78064951 |
| RMSPE (Known Locs & Future) | 4.99754748 | 8.73202540 | 5.76457259 |
| RMSPE (Unknown Locs & Future) | 4.99607198 | 8.65503450 | 5.84905012 |
| MSPE% (ALL Locs & Future) | 0.08875877 | 0.26929858 | 0.11762572 |
| MSPE% (Known Locs & Future) | 0.08882456 | 0.27033777 | 0.11704136 |
| MSPE% (Unknown Locs & Future) | 0.08847681 | 0.26484490 | 0.12013010 |
| RMSPE% (ALL Locs & Future) | 0.29792410 | 0.51893986 | 0.34296606 |
| RMSPE% (Known Locs & Future) | 0.29803450 | 0.51994016 | 0.34211308 |
| RMSPE% (Unknown Locs & Future) | 0.29745052 | 0.51463080 | 0.34659790 |
| MAPE (ALL Locs & Future) | 4.06021896 | 7.58070981 | 4.61292859 |
| MAPE (Known Locs & Future) | 4.05973676 | 7.59905546 | 4.59836726 |
| MAPE (Unknown Locs & Future) | 4.06228551 | 7.50208560 | 4.67533431 |
| MAPE% (ALL Locs & Future) | 0.01437071 | 0.02678231 | 0.01624002 |
| MAPE% (Known Locs & Future) | 0.01437764 | 0.02686171 | 0.01619796 |
| MAPE% (Unknown Locs & Future) | 0.01434101 | 0.02644200 | 0.01642026 |
From the above experiments, it can be observed that SSSD + autoFRK demonstrates relatively stable performance in time series forecasting (Future), especially in the unknown locations’ future predictions (Unknown Locs & Future), where metrics such as MSPE, RMSPE, and MAPE are significantly lower than those of TSMixer + autoFRK, and the gap compared to known locations (Known Locs) is minimal. This indicates better generalization ability at unobserved locations. However, the SSSD model incurs higher time costs, making it less suitable for scenarios requiring real-time forecasting. Increasing the number of iterations without significantly raising computational burden may further enhance its predictive power.
In contrast, TSMixer + autoFRK shows notably higher MSPE and RMSPE in time series forecasting (e.g., MSPE as high as 75.99), especially larger errors in unknown regions, indicating substantial prediction bias at unobserved locations. This model may require adjustments to improve generalization ability, such as increasing iteration count, refining training strategies, or incorporating additional features to close the gap with other methods.
The overall performance of RegressionEnsemble + autoFRK lies between SSSD and TSMixer. Although MSPE and RMSPE in unknown areas are higher than SSSD, they are much lower than TSMixer, indicating moderate to good generalization ability. Moreover, RegressionEnsemble has significantly shorter inference time than SSSD. Introducing more efficient base forecasting models without significantly increasing computational costs could potentially allow it to outperform SSSD in predictive accuracy.
Epilogue
Environment
- Local Operating System: Windows 11 24H2
- Programming Language: Python 3.12.9
- Computing Platform: National Center for High-Performance Computing (NCHC) – Taiwan AI Cloud
- Operating System: Ubuntu
- Miniconda
- GPU: NVIDIA Tesla V100 32GB GPU
- CUDA 12.8 driver
- Programming Language: Python 3.10.16 for Linux
Further Learning
- I tested this project on the GitHub repository.
References
Global Modeling and Assimilation Office (GMAO). (2015). MERRA-2 tavg1_2d_flx_Nx: 2d,1-Hourly,Time-Averaged,Single-Level,Assimilation,Surface Flux Diagnostics (Version 5.12.4) [Dataset]. Goddard Earth Sciences Data and Information Services Center (GES DISC). Retrieved from https://doi.org/10.5067/7MCPBJ41Y0K6
Juan Lopez Alcaraz, Nils Strodthoff (2022). Diffusion-based time series imputation and forecasting with structured state space models. Transactions on Machine Learning Research. Retrieved from https://openreview.net/forum?id=hHiIbk7ApW
SSSD (2022). GitHub. Retrieved from https://github.com/AI4HealthUOL/SSSD
SSSD_CP (2024). GitHub. Retrieved from https://github.com/egpivo/SSSD_CP
Unit8 SA (n.d.). Time Series Made Easy in Python. Darts. Retrieved from https://unit8co.github.io/darts/index.html
darts (2025). GitHub. Retrieved from https://github.com/unit8co/darts
Tzeng, S., & Huang, H. C. (2018). Resolution Adaptive Fixed Rank Kriging. Technometrics, 60(2), 198–208. Retrieved from https://doi.org/10.1080/00401706.2017.1345701
autoFRK (2024). GitHub. Retrieved from https://github.com/egpivo/autoFRK
Si-An Chen, Chun-Liang Li, Nate Yoder, Sercan O. Arik, and Tomas Pfister. (2023). TSMixer: An all-MLP architecture for time series forecasting. arXiv. Retrieved from https://arxiv.org/abs/2303.06053





![[Thought] Historical Earthquake Locations Around Taiwan](https://Josh-test-lab.github.io/posts/Historical%20Earthquake%20Locations%20Around%20Taiwan/cover%20image.webp)




