giddy
giddy copied to clipboard
Ability to use a generated spatial markov chain to predict the next n states
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
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.
I've experimented with this before and is currently reorganizing the code to make it complete and convenient to use.
Looking forward.
This'll move to giddy & is still an active interest.
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?
(we'd have to generalize the geosnap version for continuous data, obviously, but i mean the core logic should live here, yeah?)