giddy icon indicating copy to clipboard operation
giddy copied to clipboard

Ability to use a generated spatial markov chain to predict the next n states

Open stuartlynn opened this issue 9 years ago • 6 comments

It would be great to have a method to use a trained spatial Markov chain to predict the next n states for a set of geometries.

sm = pysal.Spatial_Markov(data, weights, fixed = True, k = 7)
prediction = sm.predict( inital_state,  weights= weights, steps=10, k=7)

where inital_state would be a list of the current state of each regions and prediction would be a list of lists which would contain the predictions for the next n steps for each region.

In addition there could be a function

prediction = sm.predict_ensembl( inital_state,  weights= weights, steps=10, trials=100, k=7)

where trials is the number of randomly seeded predictions to make. The result would be a list of the mean and variance of the predictions for the next N steps

stuartlynn avatar Nov 30 '15 20:11 stuartlynn

Is this issue fixed. If not Can you tell me how you want to things to be implemented ? I haven't worked with pysal till of now but I have worked in probabilistic graphical models, and currently was working on implementing sampling based on Hamiltonian Monte Carlo. With help I can work this off. Can you suggest starting point specifically code base section that I should go through.

khalibartan avatar Mar 01 '16 16:03 khalibartan

I've experimented with this before and is currently reorganizing the code to make it complete and convenient to use.

weikang9009 avatar Mar 01 '16 18:03 weikang9009

Looking forward.

khalibartan avatar Mar 01 '16 18:03 khalibartan

This'll move to giddy & is still an active interest.

ljwolf avatar Jul 11 '17 22:07 ljwolf

Trying to reconstruct a timeline from memory today for how geosnap came into being, I went looking for this old issue assuming it was over here.

Instead I saw this issue for the first time in years 😂. To close the loop, I've got a simple version of this implemented over in geosnap. It only does a single draw from the spatially-conditioned probs, but should be trivial to wrap in a loop to generate the parameters @stuartlynn wants, no?

Either way, I'd think if that implementation is correct, we should move it here then extend if @ljwolf and @weikang9009 agree?

knaaptime avatar Feb 04 '22 19:02 knaaptime

(we'd have to generalize the geosnap version for continuous data, obviously, but i mean the core logic should live here, yeah?)

knaaptime avatar Feb 04 '22 19:02 knaaptime