Modelling length of traffic jam using a neural networkI have a 760 record daabase with length of traffic jam data; so fatr there is one very significant input variable as expected the hour of the day: there is a sharp maximum at 8:00 hour in the morning and a broad maximum around 16:00 hour in the afternoon. It is possible the model quite accurately the traffic jam lenghth as a function of day hour with a 10th order polynomal function (no overfitting, the coëfficiënt of the 10th power is significant) using least squares regression. However trying to model with a one layer neural network and several nodes the broad maxiumum at 4 - 5 in the afernoon is OK but in the morning a sharp maximum always occurs one hour too early i.e. at 7 am; increasing the number of nodes from 2 even to10 does not help. Should I use more layres? Possible in jmp? How many nodes/layer are recomended?
Thanks for help, I will get more data and inputs soon and I would like to train and build a model using a neural network.
Re: Modelling length of traffic jam using a neural networkTime series analysis requires observations that are equally spaced in time. Time series analysis is about predicting the future based on the disturbances observed in the past, usually most recent observations are weighted more heavily. There are many possible models under time series. The proof is in the performance.
Re: Modelling length of traffic jam using a neural networkHi Marc, I would like to come back on my traffic case you nicely modelled using a spline approach. Do you think it would be possible to use this in time series analysis i.e. use the spline function to model the time trend and ARIMA autoregressive residuals? Next this hybrid moldel could be entered in a neural net to get accurate predictions.This is a well known approach however moving average is generally used to model the time trend but I expect the spline approach is better?
Re: Modelling length of traffic jam using a neural networkYes but it would be a manual process.
Re: Modelling length of traffic jam using a neural networkDifferent modeling techniques differ in their details but generally, regardless of their structure, the more complex the response, the more complex the model, of any given type. In a way, it is a matter of how many parameters are required to approximate the response with minimum variance. That is why you needed a very high order of polynomial for the linear predictor in the regression model. That is why I needed many nodes in the neural network model.
You will likely need additional nodes or a second hidden layer (which requires JMP Pro that you don't have) when you introduce additional predictors to the NN model, Just like you would need to add terms to the linear predictor to the regression model.
There are many rules of thumb in this world because people like them, not because they are particularly good.
"For every complex question there is a simple answer, and it is wrong." (H. L. Mencken)
Re: Modelling length of traffic jam using a neural networkI there a way to carry out crossvalidation with the spline fit so risk for overfitting is eleminated?
Re: Modelling length of traffic jam using a neural networkMarc, this works fine, thanks a lot for your expert avidvice. I had never realized that so many nodes are required with only hour as input. I have more potential input variables so I can imagine that > 8 nodes will be required? Is there anay guideline about #nodes? I read an article that this is square root of #data, in this case 2 - 3, obviously wrong. Kind regards, Frank
Re: Modelling length of traffic jam using a neural networkThank you for sharing your example. I did not find any effect of Day, alone or as part of an interaction with any power of Hour, so it is eliminated. You can now use the Bivariate platform and the Flexible > Spline fit. Adjust the parameter as needed. I started with a value of 1 and got good results:

(You can also include terms as spline effects with Fit Model, but it easier to explore the needed flexibility here.)
You can save the fit and the residuals by clicking the red triangle next to Smoothing Spline Fit under the scatter plot and selecting Save Predicteds and Save Residuals.Here is the actual L by predicted L scatter plot with the identity line added for reference:

Looks very good to me! Here are the L residuals by predicted L:

Likewise, these results look very good. You can use the column formula for predictions, too:

This way seems more straight-forward and satisfying than polynomial models (fixed shapes) or neural network models. I explored NN models, too, because they are generally excellent approximators. The NN with 8 hidden nodes using the hyperbolic tangent activation function in a single layer seemed to minimize bias and variance nicely, and predictions agree well with spline model:

What is the advantage of log L? People have easier interpretation when distance is linear.
Re: Modelling length of traffic jam using a neural networkI forgot to mention: jmp 13 standard version is used (not pro).
Re: Modelling length of traffic jam using a neural networkFind attached the data.Goal is to model Log(L) vs. hour and day (there are other inputs but they are not relevant here). Bivariate 6th order polynomal fit does well vs. hour however neural model fails in the morning..
Re: Modelling length of traffic jam using a neural networkWhat version of JMP are you using?
What options and settings in Neural are you using?
May we see the data for inspection and investigation?
Re: Modelling length of traffic jam using a neural networkI don't understand why neural net can't model my case; it is used intensively in machine learning. Why does neural net always predict the maximum traffic jam length one hour to early in the morning? Maybe I should use more layers in my neural net to ge an accurate prediction, I don't know..
Re: Modelling length of traffic jam using a neural network see, then forget survival analysis. I am surprised that you require such a high order polynomial to fit the data. even if the highest order term is significant, what does the residual analysis, leverage, and influence show?
I am also surprised that a neural network with that many nodes did not fit as well. They are very flexible interpolaters.
You might consider splines and Gaussian process models for purely predictive applications.
Re: Modelling length of traffic jam using a neural networkMarc, my is response a length in km, input is the hour of the day where for length I get two maxima: one at 8:00 am and one at 16:00 h
Re: Modelling length of traffic jam using a neural networkI am not discouraging you from modeling the data with a neural network but since your response is 'life' or 'time to event' data, have you considered using a reliability/survival model?