stm function

Spatial and temporal model