MATLAB: Optimal hidden nodes number

hidden nodesneural networkprediction

Dear friend,
I want to determine the optimal number of hidden nodes using narnet in order to predict the next'day index, i have just a question:
I found two proposition about Hmax:
1) Hmax= Hub
or
2) Hmax=floor(Hub/10)% for example, but I have not understand how we can determine the number "10"
What is the difference between these two propositions and what's the right one.
Thanks

Best Answer

Neither is always the right one. There are many ways to choose a value that works. I typically start searching with ~10 values in a range 1<= Hmin <= H <= Hmax <= Hub by trial and error. The upper bound Hub is chosen so that the number of training equations, Ntrneq, is not less than the number of unknown weights Nw. For robust designs it is desired that Hmax << Hub. That is where the empirical factor of 10 comes from. For each value in the range I usually design Ntrials = 10 candidates for a total of 100 designs. On rare occasions I have used Ntrials = 15 or 20.
I have explained this logic so many times it is ridiculous for me to say any more than search the NEWSGROUP and/or ANSWERS using any subset of the above variables. Usually
greg Hub Ntrials
is sufficient.
If there is not enough data to provide enough equations so that Ntrneq >> Nw, it is wise to use or combine an alternate approach like validation-set-stopping and/or regularization. I tend to use valstop. For the latter search on
help msereg
doc msereg
help trainbr
doc trainbr
There is recent evidence (Sorry, I lost the reference) that, for difficult designs, combining valstop and regularization can be very effective.
Hope this helps.
Thank you for formally accepting my answer
Greg