tessl install tessl/pypi-spreg@1.8.0Spatial econometric regression models for analyzing geographically-related data interactions.
Agent Success
Agent success rate when using this tile
87%
Improvement
Agent success rate improvement when using this tile compared to baseline
0.95x
Baseline
Agent success rate without this tile
92%
A tool for analyzing housing price data to detect spatial patterns and dependencies using diagnostic tests.
You are building a data analysis tool that helps urban planners and economists determine whether housing prices in a region exhibit spatial patterns. Specifically, the tool should run an initial regression analysis and then perform diagnostic tests to determine if:
The tool should provide clear recommendations based on the test results about which spatial model specifications might be appropriate for the data.
The tool should accept:
The tool should report:
@generates
def analyze_spatial_patterns(y, X, w):
"""
Analyzes housing price data for spatial patterns using diagnostic tests.
Parameters
----------
y : numpy.ndarray
Dependent variable (housing prices), shape (n, 1)
X : numpy.ndarray
Independent variables (property characteristics), shape (n, k)
w : object
Spatial weights matrix defining neighborhood relationships
Returns
-------
dict
Dictionary containing:
- 'error_test': dict with 'statistic' and 'p_value' for spatial error test
- 'lag_test': dict with 'statistic' and 'p_value' for spatial lag test
- 'recommendation': string describing which spatial model (if any) is appropriate
"""
passProvides spatial econometric regression and diagnostic testing capabilities.
Provides array data structures and numerical operations.