TrendSurfaceAnalysis

Enhanced Trend Surface Analysis Plugin Documentation

Overview

The Enhanced Trend Surface Analysis Plugin is a powerful QGIS tool for spatial trend analysis using polynomial regression. It allows users to model spatial patterns in point data and generate trend surfaces with comprehensive statistical diagnostics.

Table of Contents

  1. Features
  2. Installation
  3. Quick Start
  4. User Interface
  5. Parameters Explained
  6. Outputs
  7. Use Cases
  8. Troubleshooting
  9. Mathematical Background
  10. FAQ

Features

Core Analysis

Advanced Capabilities

User Experience

Installation

System Requirements

Installation Steps

  1. Download the Plugin
    # Clone from repository or download ZIP
    git clone https://github.com/your-repo/enhanced-trend-surface.git
    
  2. Install in QGIS
    • Open QGIS
    • Go to Plugins → Manage and Install Plugins
    • Click Install from ZIP
    • Select the plugin directory or ZIP file
    • Click Install Plugin
  3. Verify Installation
    • Check for “Enhanced Trend Surface” in the Plugins menu
    • Look for the plugin icon in the toolbar

Manual Installation

# Copy to QGIS plugins directory
cp -r EnhancedTrendSurface ~/.local/share/QGIS/QGIS3/profiles/default/python/plugins/

Quick Start

Basic Workflow

  1. Load your point data with elevation/Z values
  2. Click the plugin icon or go to Plugins → Enhanced Trend Surface → Enhanced Trend Surface Analysis
  3. Select input layer and Z value field
  4. Choose analysis parameters (polynomial degree, cell size)
  5. Set output locations for results
  6. Click “Run Analysis” and view results

Example: Topographic Analysis

  1. Load a point layer with elevation data
  2. Set polynomial degree to 2 (quadratic surface)
  3. Use 100m cell size for output raster
  4. Run analysis to visualize regional topography

User Interface

Main Dialog Components

Input Parameters Section

Analysis Options

Output Settings

Parameters Explained

Polynomial Degree

Degree Equation Terms Use Case
1 3 (planar) Simple linear trends
2 6 (quadratic) Gentle curvature, basic topography
3 10 (cubic) Complex surfaces, geological features
4+ 15+ Highly complex patterns (use with caution)

Recommendation: Start with degree 2-3 for most applications.

Cell Size

Confidence Level

Outputs

Generated Layers

1. Trend Surface Raster

2. Residual Points Layer

3. Residuals Surface Raster (Optional)

4. Confidence Intervals Raster (Optional)

Statistical Reports

Comprehensive Statistics

ENHANCED POLYNOMIAL TREND SURFACE ANALYSIS REPORT
==================================================

Analysis Date: 2024-01-15 14:30:25
Polynomial Degree: 2
Number of Observations: 250
Number of Parameters: 6

GOODNESS OF FIT STATISTICS:
R²: 0.8743
Adjusted R²: 0.8712
RMSE: 12.45
MAE: 8.67

MODEL SELECTION CRITERIA:
AIC: 1456.23
BIC: 1478.45

RESIDUAL ANALYSIS:
Residual Mean: 0.0234
Residual Std: 12.38
Normality Test p-value: 0.2345

CROSS-VALIDATION RESULTS:
CV R²: 0.8621
CV MSE: 156.34
Folds Completed: 5

Use Cases

1. Topographic Analysis

2. Environmental Monitoring

3. Geological Applications

4. Climate Studies

Troubleshooting

Common Issues

“Insufficient points” Error

“Matrix solving failed” Error

Poor Model Fit (Low R²)

Performance Tips

For Large Datasets

For Complex Patterns

Mathematical Background

Polynomial Trend Surface

A polynomial trend surface of degree d is defined as:

z(x,y) = β₀ + β₁x + β₂y + β₃x² + β₄xy + β₅y² + ... + βₙyᵈ

Where:

Least Squares Regression

The coefficients are determined by minimizing the sum of squared residuals:

min Σ(z_observed - z_predicted)²

Solved using the normal equations:

β = (AᵀA)⁻¹Aᵀz

Where A is the design matrix of polynomial terms.

Robust Regression

Uses iteratively reweighted least squares with Huber weighting:

w_i = min(1, k / |r_i|)

Where r_i are residuals and k is a tuning constant.

FAQ

Q: What’s the difference between degree 1, 2, and 3?

Q: When should I use robust regression?

Use robust regression when your data contains outliers or when you want to reduce their influence on the trend surface.

Q: How many points do I need?

Minimum points = number of polynomial terms + 10. For degree 2 (6 terms), aim for at least 16 points.

Q: Can I use this for categorical data?

No, the plugin is designed for continuous numeric data. For categorical data, consider classification methods.

Q: Why are my residuals clustered spatially?

Spatial clustering of residuals suggests local effects not captured by the global trend. Consider local interpolation methods for these areas.

Q: How do I interpret R² values?

Advanced Usage

Batch Processing

For multiple datasets, consider using the Python API:

from EnhancedTrendSurface.core_analysis import TrendSurfaceAnalyzer

analyzer = TrendSurfaceAnalyzer()
results = analyzer.analyze(layer, 'elevation', degree=3, cell_size=50)

Custom Styling

Modify the automatic styling by editing the style functions in the plugin code.

Support and Development

Getting Help

Contributing

We welcome contributions! Areas for improvement:

Citation

If you use this plugin in research, please cite:

S. S. Goveia. Enhanced Trend Surface Analysis Plugin for QGIS. Version 1.0. 
Spatial Analysis Tools. 2025.

Note: This documentation is for version 1.0 of the Enhanced Trend Surface Analysis Plugin. Check for updates and new features in subsequent releases.