Re: Designing API for a Markov Model

2014-09-15 Thread Quzanti
Is there a limited number of models? The model should stay decoupled from the state as they are totally distinct so general-fn[model old-state] - new-state then either you (if you know the model) or the user if they can choose any model should define a partial fn partial specific-model-fn

Re: Designing API for a Markov Model

2014-09-15 Thread RJ Nowling
Consensus seems to be: (progress-state model old-state) - new-state and use currying to create a closure around the model. Thanks! On Mon, Sep 15, 2014 at 5:18 AM, Quzanti quza...@googlemail.com wrote: Is there a limited number of models? The model should stay decoupled from the state as

Re: Designing API for a Markov Model

2014-09-14 Thread Jony Hudson
It's nice if the function returns the same sort of data as it consumes, because then it's easy to repeat it with `iterate` or `reduce`. So, if you take your first example, then you could write: (take 100 (iterate (partial progress-state markov-model) initial-state)) to get the next 100

Re: Designing API for a Markov Model

2014-09-14 Thread RJ Nowling
Thanks for the response! You make a really good point about the first interface -- makes it easy to use with the built in functions. The only things that really define the process is the model (a transition matrix) and the current state. The model doesn't change but the current state does. The

Re: Designing API for a Markov Model

2014-09-14 Thread Christopher Small
A few questions out of curiosity, if you don't mind: * Have you looked at existing MM libraries for Clojure? * Is there something you need that other's don't currently offer/emphasize; or is this more of a learning project? * Are you planning on or interested in open sourcing your work? Best

Re: Designing API for a Markov Model

2014-09-14 Thread RJ Nowling
Hi Chris, I'm more than happy to answer questions. General background for the project: My friend Jay Vyas initiated BigPetStore, a big data application blueprint for the Hadoop ecosystem centered around transaction data for a fictional chain of pet stores. BigPetStore is currently part of the

Designing API for a Markov Model

2014-09-13 Thread RJ Nowling
Hi all, I'm new to Clojure and implementing a Markov Model as part of a larger project. I'd like some advice on the API for a progress-state function. I see two possible options. In the first option, we always ask the user to provide and keep track of the MSM state themselves: