locked
Extending the Cyclist example RRS feed

  • Question

  • I've been going through the Cyclist example and I was wondering how I can extend it?

    1) How could I add a second input that influences the travel time e.g. Weather (Fine|Rain)? 

    2) The 5th example adds a second Cyclist. It doesn't look like the times from Cyclist 1 helps determine the times for Cyclist 2. Is it possible to do this?

    Thanks

    Pater

    Tuesday, February 5, 2013 9:45 PM

All replies

  • Hi Pater

    (1) It depends how you want to model this. We have kept to fairly simple assumptions in the cyclist model and it is difficult to extend without breaking some of these original assumptions. So for example, one could imagine that the traffic noise variable is dependent on the weather. But the unexpected event (flat tyre etc) may not be dependent on the weather. In which case you could have a mixture model conditioned on weather state, and in each component conditional add an additional time (to be inferred) conditioned on an unexpected event occurring.

    (2) You can do this by building a hierarchical model. You would need to restructure the code a little bit. You would have variables AverageTimeMean and AverageTimePrecision and AverageTime would derive from these for each cyclist:

    AverageTime[Cyclist] = Variable.GaussianFromMeanAndPrecision(AverageTimeMean, AverageTimePrecision).ForEach(Cyclist) where Cyclist is a range over cyclists.

    AverageTimeMean and AverageTimePrecision would derive from Gaussian and Gamma priors (using the Random factor).

    Thursday, February 7, 2013 3:18 PM
    Owner
  • Hi John,

    Thanks for the comments.

    1) What if I'm not sure how that variable impacts on the travel time. For example if the Cyclist has 3 bikes, A, B, and C and the bikes impacted the travel time differently but we want the engine to work out how during inference?

    2) Ok, I will play around with that. Does this mean the times from other cyclists is really just used as a prior for the current cyclist and then further inference is performance using their data?

    Saturday, February 9, 2013 11:42 AM
    1. If you are not sure which model is better, you should implement both models and compare them using model evidence.
    2. Not really. You can imagine one scenario where all cyclists are pretty much the same - there may be variation from day to day, but on average all cyclists are the same. In another scenario, cyclists are very different, one is typically fast, the other typically slow. In the first case, the AverageTimePrecision variable (which represents the variation around the mean of different cyclists) will be inferred quite differently.

    Monday, February 11, 2013 9:32 AM
    Owner