Implementing initial weights and significant feedback delays in a NARNET

Hi. I’m trying to understand the concepts behind finding training strategies for NARNETs that can make as good predictions as possible. What I want to create is a script that I can feed any time series to, regardless of how it looks, and then find the best training design for it. This is the code I have at the moment:
T = simplenar_dataset; %example time series
N = length(T); % length of time series
MaxHidden=10; %number of hidden nodes that will be tested
%Attempt to determine Significant feedback delays with Autocorrelation
autocorrT = nncorr(zscore(cell2mat(T),1),zscore(cell2mat(T),1),N-1);
[ sigacorr inda ] = find(abs(autocorrT(N+1:end) > 0.21))
for hidden=1:MaxHidden
parfor feedbackdelays=1:length(inda)
FD=inda(feedbackdelays);
net = narnet( 1:FD, hidden );
[ Xs, Xsi, Asi, Ts ] = preparets( net, {}, {}, T );
ts = cell2mat( Ts );
net.divideFcn ='divideblock'; %Divides the data using divide block
net.trainParam.min_grad=1e-15;
net.trainParam.epochs=10000;
rng( 'default' )
[ net tr Ys Es Af Xf ] = train( net, Xs, Ts, Xsi, Asi);
NMSEs = mse( Es ) /var( ts,1 )% Mean squared error performance function
performanceDivideBlockNMSEs(hidden,feedbackdelays)=NMSEs;
end
end
First off: Is this the correct way of implementing the statistically significant feedback delays?
And if the “net.divideFcn ='divideblock'” line is left uncommented as in the code now I get an error message in the loop saying “Attempted to access valInd(0); index must be a positive integer or logical.” which I’m not sure what is causing.
And I’ve heard people say that you should “try different initial weights”, how do I do that, is it the rng command I need to change?
The idea here is then that I find the address of the best performing net in the performanceDivideBlockNMSEs matrix so I can retrain a closed net with those settings and make predictions, but for now I’m just focusing on the open net.
Thanks

 Accepted Answer

1. Unfortunately, the form of NNCORR that you are using is BUGGY!
PROOF:
a. plot(-(N-1):N-1, autocorrT)
b. minmax(autocorrT) = [ -2.3082 1.0134 ]
c. sigacorr = ones(1,41)
2. BETTER SOLUTION: Use the Fourier Method
za = zscore(a,1); zb = zscore(b,1); % a,b are double (i.e., not cells)
A = fft(za); B = fft(zb);
CSDab = A.*conj(B); % Cross Spectral Density
crosscorrFab = ifft(CSDab); % F => Fourier method
crosscorrFba = conj(crosscorrFab);
3. You might wish to compare this with the NNCORR documentation options
help nncorr
doc nncorr
% The optional FLAG determines how nncorr normalizes correlations.
% 'biased' - scales the raw cross-correlation by 1/N.
% 'unbiased' - scales the raw correlation by 1/(N-abs(k)), where k
% is the index into the result.
% 'coeff' - normalizes the sequence so that the correlations at
% zero lag are identically 1.0.
% 'none' - no scaling (this is the default).
crosscorrBab = nncorr( za, zb, N-1, 'biased' ); % B ==> "b"iased
crosscorrNab = nncorr( za, zb, N-1, 'none' )/N; % N ==> "n"one
crosscorrUab = nncorr( za, zb, N-1, 'unbiased' ); % U ==> "u"nbiased
crosscorrtMab = nncorr( za, zb, N-1 ); % M ==> "m"issing flag
% crosscorrCab = nncorr( za, zb, N-1, 'coeff' ); ERROR: BUG
You should find that B & N are equivalent, Similarly for U & M.
Therefore, there are really only 2 NNCORR options to consider: Biased and Unbiased.
It is instructive to overlay the plot combinations F&B, F&U, B&U. Most notable is that for lags greater than ~N/2 the three are, in general, quite different. Although the differences are much less for lags < N/2, I recommend using the Fourier method or one of the correlation functions from other toolboxes.
4. Once thresholding yields the "significant" lags, use as few lags and hidden nodes as possible to avoid "overfitting". Performance on non-training data tends to decrease as the ratio of number of unknown parameters to number of training equations increases.
Hope this helps.
Thank you for formally accepting my answer
Greg

9 Comments

1. The code
parfor feedbackdelays=1:length(inda)
FD=inda(feedbackdelays);
is confusing. Simply
FD = inda;
2. Multiple designs with Ntrial sets of initial weights for each of the number of candidate hidden nodes are easily obtained by using a double for loop
rng(0)
j=0
for h = Hmin:dH:Hmax
j=j+1
...
for i = 1:Ntrials
configure(net,...);
...
end
end
HOWEVER, the nets should be ranked by the (nontraining) validation error performance. THEN, unbiased estimates of performance on unseen data is estimated via the (nontraining) test set performance.
I have posted many, many examples in the NEWSGROUP and ANSWERS. Search on
greg Hmax Ntrials
Hope this helps.
Greg
Thanks for trying to explain.
But in the Fourier method where you begin by defining the zscore of a and b, what does a and b represent?
And I don’t understand what you mean by “Once thresholding yields the "significant" lags”. Is the significant lags not supposed to be a vector or numbers that I loop through one by one and then use one of the performance measuring parameters to determine which worked best?
And since you, if I understand correctly, seem to think the mean square error I have now :
NMSEs = mse( Es ) /var( ts,1 )
gives a poor representation of the net performance, how would I write it instead to get the performance of the non-training data?
>Thanks for trying to explain
YW. Sometimes days go by before I can enjoy my hobby of answering questions about NNs. However, I have been doing this for so long that most of the questions have already been answered on one of the following
comp.ai.neural-nets
The NEWSGROUP
ANSWERS
So, it may be quicker to search including "greg" as a search word before posting.
>But in the Fourier method where you begin by defining the zscore of a and b, what does a and b represent?
Two Fourier transformable functions. In our case input and target series. (target = input for NARNET)
>And I don’t understand what you mean by “Once thresholding yields the "significant" lags”. Is the significant lags not supposed to be a vector or numbers that I loop through one by one and then use one of the performance measuring parameters to determine which worked best?
Significant lags are the delays at which the absolute value of the correlation function of the input and output exceeds a specified threshold level. I use the 95% confidence level which I determine by estimating the cumulative distribution function of Gaussian-distributes random noise. Check a statistics reference (e.g., wiki) to find the formal definition of confidence levels. I interpret it to mean that, even if the signals were pure noise, there is only a 5% chance of error by choosing values above the threshold.
For example, for a certain NARNET input, the significant feedback lags may be FD = [ 1 3 5 ]. Typically you would determine which combination to use by trial and error.
> And since you, if I understand correctly, seem to think the mean square error I have now : NMSEs = mse( Es ) /var( ts,1 ) gives a poor representation of the net performance, how would I write it instead to get the performance of the non-training data.
Among other things, the training record, tr, contains the indices and performances of the trn/val/tst subsets. After using [ net tr y e Xf Af ] = train(... ), you can see the contents of the training record tr by typing
tr =tr (WITHOUT SEMICOLON).
Hope this helps.
Greg
So you mean that the values calculated in crosscorrFba = conj(crosscorrFab) should be compared to a randomly generated series to see if they are within the 95th percentile of that series? And those values of crosscorrFba that are are the only ones that are significant and should be tried as feedback delays in the net?
Statistics is not something I have a lot of experience with but I’ve tried (and failed?) interpreting your advice with:
Mi=min(abs(crosscorrFba)); %minumum absolute value of correlation function
Ma=max(abs(crosscorrFba)); %maximum absolute value of correlation function
x=[Mi:0.1:Ma]; %range of cross correlation values
mu =mean(x); %mean value of that range
sigma = std(x); %standard deviation of that range
pd = makedist('Normal',mu,sigma); %normal distribution object
y = cdf(pd,x); %cumulative distribution function
Y = prctile(y,95) %95th percentile
But the results I get from prctile(y,95) appears to indicate that what I’m doing is terribly wrong. How do you do the 95% confidence check?
And inside tr there are a lot of different things, these sounds like training, validation, test indices and performance that you mentioned:
trainInd: [1x71 double]
valInd: [72 73 74 75 76 77 78 79 80 81 82 83 84 85]
testInd: [86 87 88 89 90 91 92 93 94 95 96 97 98 99]
perf: [0.2233 0.0602 0.0578 0.0526 0.0524 0.0523 0.0523 0.0523 0.0523 0.0522 0.0522]
But apart from the perf record I don’t understand what the others tell me about the performance of the net. What am I looking for here? The matlab documentation on these parameters seems to be either well hidden or none existing
>So you mean that the values calculated in crosscorrFba = conj(crosscorrFab) should be compared to a randomly generated series to see if they are within the 95th percentile of that series?
Yes.
>And those values of crosscorrFba that are are the only ones that are significant and should be tried as feedback delays in the net?
NO! They are INSIGNIFICANT if they are not higher than 95% of correlations calculated from noise!
>Statistics is not something I have a lot of experience
Look up significance testing in a stats reference. Most of the documentation deals with differences in estimates of means or ratios of variances. However, you will get the idea quickly. Wikipedia probably does a decent job.
>but I’ve tried (and failed?) interpreting your advice with: Mi=min(abs(crosscorrFba)); %minumum absolute value of correlation function Ma=max(abs(crosscorrFba)); %maximum absolute value of correlation function
My point was that autocorrelations of nonperiodic functions have both
- a single maximum value of 1 at zero lag
- a single maximum absolute value of 1 at zero lag
Therefore, I don't trust estimates that have absolute values that exceed unity
>x=[Mi:0.1:Ma]; %range of cross correlation values mu =mean(x); %mean value of that range sigma = std(x); %standard deviation of that range pd = makedist('Normal',mu,sigma); %normal distribution object y = cdf(pd,x); %cumulative distribution function Y = prctile(y,95) %95th percentile
But the results I get from prctile(y,95) appears to indicate that what I’m doing is terribly wrong. How do you do the 95% confidence check?
1. Calculate the autocorrelation function of Gaussian random noise of length N
2. Sort the 2*N-1 absolute values
3. The absolute value at index floor(0.95*(2*N-1)) is the 95% confidence level.
4. Function auto/crosscorrelations greater or equal to that value are considered significant
5. Choose among the significant lags for values to use in timeseries design
I'm surprised you couldn't find that explanation and examples by searching the NEWSGROUP and ANSWERS using
greg nncorr
(;>{
>And inside tr there are a lot of different things, these sounds like training, validation, test indices and performance that you mentioned: trainInd: [1x71 double] valInd: [72 73 74 75 76 77 78 79 80 81 82 83 84 85] testInd: [86 87 88 89 90 91 92 93 94 95 96 97 98 99] perf: [0.2233 0.0602 0.0578 0.0526 0.0524 0.0523 0.0523 0.0523 0.0523 0.0522 0.0522]
> But apart from the perf record I don’t understand what the others tell me about the performance of the net. What am I looking for here? The matlab documentation on these parameters seems to be either well hidden or none existing
Most of the time I am just interested in
1. Why training stopped
2. How long did it take
3. What are the final perf values for trn/val/tst and total.
How well the net generalizes (performs on nontraining data) is the most important info.
The best of multiple designs is decided by valperf
testperf of the best design is an UNBIASED estimate of the best peformance you can expect on unseen data.
If you want to make additional statistical analyses and plots from multiple designs, the info is in tr!
Hope this helps.
Greg
Ok, I’ve read some more, tried some more and I’ve now written the 95% check like this:
X=randn(N,1); %Random series with normal (gaussian?) distribution of length N
[Rxx,lags] =xcorr(X,'coeff'); %Autocorrelation function of X
B = sortrows(abs(Rxx)); %Absolute values sorted from small to large
B(floor(0.95*(2*N-1))) % 95% confidence level
crosscorrFba(crosscorrFba<B(floor(0.95*(2*N-1))))=[];
You said that the autocorrelation of nonperiodic functions should have a maximum value of 1 at zero lag. I think the ‘ coeff ’ syntax in xcorr makes sure that is the case, but it also makes the rest of the values in Rxx so small that crosscorrFba(crosscorrFba<B(floor(0.95*(2*N-1))))=[] basically just means that I’m removing the negative values in crosscorrFba . Should it be like that or should I perhaps instead use [Rxx,lags] =xcorr(X,'none') which doesn’t have 1 as a value at zero lag but results in bigger values?
And two other questions concerning the autocorrelation – should crosscorrFba be as it is now or expressed in absolute values when removing values smaller than B(floor(0.95*(2*N-1))) ? And the values in crosscorrFba are non-integers which I guess can’t be fed into the net, should they first be rounded up/down or it doesn’t matter?
And in terms of performance, if I log the tr.best_tperf for each net in the loop, the one that has the lowest value is the one I can expect the most accurate predictions from right? All other performance indicators are irrelevant since they are not tested under realistic prediction conditions were the step-head data is unknown?
Implementing initial weights and significant feedback delays in a NARNET Asked by Peta on 21 Apr 2015 at 21:26
X=randn(N,1); %Random series with normal (gaussian?) distribution of length N
%GEH1: a. NN series are rows b. Use UC for cells and LC for doubles
[Rxx,lags] = xcorr(X,'coeff'); %Autocorrelation function of X
% GEH2: Lucky you. I do not have this function!
% GEH3: plot(lags,Rxx)
B = sortrows(abs(Rxx)); %Absolute values sorted from small to large
%GEH4: Are you sure xcorr yields 2*N-1 lags?
B(floor(0.95*(2*N-1))) %95% confidence level
% GEH5: why not define CL95 = B(floor(0.95*(2*N-1))) ?
crosscorrFba(crosscorrFba<B(floor(0.95*(2*N-1))))=[];
% GEH6: ERROR: Deal with absolute values!
% GEH7: ERROR: indexing ruined! a = [ 1:10 ]; a(a<5)=[]; a(2) = 6
% GEH8: Why in the world are you messing around with crosscorrF when you are lucky enough to have Rxx ??
% GEH9: If you are only dealing with narnet autocorrelations why use the notation crosscorr ?
You said that the autocorrelation of nonperiodic functions should have a maximum value of 1 at zero lag.
%GEH10: NO! The autocorrelation of ALL functions have a maximum at zero lag. Periodic functions will have other unity maxima.
I think the ‘coeff ’ syntax in xcorr makes sure that is the case,
% GEH11: Think? Why don't you read the help documentation and why don't you look at a sample tabulation and plot??
but it also makes the rest of the values in Rxx so small that crosscorrFba(crosscorrFba<B(floor(0.95*(2*N-1))))=[] basically just means that I’m removing the negative values in crosscorrFba . Should it be like that or should I perhaps instead use [Rxx,lags] =xcorr(X,'none') which doesn’t have 1 as a value at zero lag but results in bigger values?
%GEH12: Rxx=1 at lag 0
%GEH13: If you don't like the other values, compare with autocorrFxx In fact, why don't you plot them both on the same graph?
%GEH14: Remember that you are filtering on ABSOLUTE values.
And two other questions concerning the autocorrelation – should crosscorrFba be as it is now or expressed in absolute values when removing values smaller than B(floor(0.95*(2*N-1))) ?
%GEH15: See GEH14
And the values in crosscorrFba are non-integers which I guess can’t be fed into the net, should they first be rounded up/down or it doesn’t matter?
%GEH16: This makes no sense at all. Of course the values are nonintegers. Absolute values of nonzero lag correlations are never more than unity. What in the world are you trying to round?
%GEH17: The net inputs are a subset of the significant the integer lags, not correlation values.
And in terms of performance, if I log the tr.best_tperf for each net in the loop, the one that has the lowest value is the one I can expect the most accurate predictions from right? All other performance indicators are irrelevant since they are not tested under realistic prediction conditions were the step-head data is unknown?
%GEH18: No.
1. The best of multiple designs is chosen by tr.best_vperf !
2. The UNBIASED estimate of net performance on unseen data is obtained from the value of tr.best_tperf obtained from the net chosen in 1.
GEH19: For serious work I usually
1. Obtain the significant lags from fft or nncorr.
2. Use a subset of the lags in 1.
3. Use a double loop search over 10 hidden node values and 10 combinations of random datadivisions & weightinitializations
4. Tabulate and plot the summary statistics of the 100 designs for the training, validation and test subsets
5.Examples have been posted
Hope this helps.
Greg
Oh my, I don’t seem to be getting a lot of things right with this correlation business! thanks for your patience though
%GEH1: a. NN series are rows b. Use UC for cells and LC for doubles
I take it you are suggesting I change the rows/columns placement like so: X=randn(1,N); ? But I don’t understand what you mean with the abbreviations UC and LC.
%GEH4: Are you sure xcorr yields 2*N-1 lags?
According to the documentation “r = xcorr(x) returns the autocorrelation sequence of x” And what I’m getting has length 2*N-1 so it seems reasonable.
% GEH8: Why in the world are you messing around with crosscorrF when you are lucky enough to have Rxx ??
I’m using the crosscorrF from the fourier method because you suggested that it as a good solution, but assuming you are implying that Its unnecessary when I have access to xcorr I’ve now tried rewriting it using only xcorr as:
X=randn(1,N); %Random series
[Rxx,lags] =xcorr(X,'coeff'); %Autocorrelation function of X
RandomCorrelationMatrix(:,1)=abs(Rxx); %Making it into absolute values
RandomCorrelationMatrix(:,2)=lags; %Turn into matrix for easier sorting
RandomCorrelationMatrix=sortrows(RandomCorrelationMatrix,1); %Sort matrix
[RXxx,lagss] =xcorr(cell2mat(T),'coeff');%same procedure but with NN series
NNCorrelationMatrix(:,1)=abs(RXxx); %Correlation values as absolute
NNCorrelationMatrix(:,2)=lagss;
CL95=RandomCorrelationMatrix(floor(0.95*(2*N-1))); 95% confidence level
NNCorrelationMatrix(NNCorrelationMatrix(:,1)<CL95)=nan; %nan instead of [] to keep indexing
Keepers = ~isnan( NNCorrelationMatrix ); %create logic index for values to keep (that isn’t nan)
FD=NNCorrelationMatrix(Keepers(:,1),2); %Feedback delays to be tested in NN
The correlation values are now always handled as absolute values, but should the lag values also be absolute or can they be negative? I’ve noticed that it is possible to give the net negative feedback lags without it complaining, but the performance after training seems to be horrible.
% GEH9: If you are only dealing with narnet autocorrelations why use the notation crosscorr ?
I have yet to reach a mental stage of enlightenment where I fully appreciate the difference between an autocorrelation and a crosscorrelation. Hopefully, with time, I will.
% GEH11: Think? Why don't you read the help documentation and why don't you look at a sample tabulation and plot??
I have, sorry for using the word think in vain, the correlation values have a max value of 1 at zero lag.
%GEH16: This makes no sense at all. Of course the values are nonintegers. Absolute values of nonzero lag correlations are never more than unity. What in the world are you trying to round? %GEH17: The net inputs are a subset of the significant the integer lags, not correlation values.
Yes, that does make a whole lot more sense than what I was trying before, I was confused and was trying to use the correlation values as lags, thanks for clearing that up.
%GEH18: No. 1. The best of multiple designs is chosen by tr.best_vperf ! 2. The UNBIASED estimate of net performance on unseen data is obtained from the value of tr.best_tperf obtained from the net chosen in 1.
I don’t understand the reasoning here: if the unbiased estimate of net performance is acquired from tr.best_tperf, why not chose the best of multiple designs directly from that parameter instead of tr.best_vperf?
If the net with the best tr.best_tperf is chosen, that value is not an unbiased estimate of performance on unseen data (You saw the performance value before you chose the net!).

Sign in to comment.

More Answers (1)

%GEH1: a. NN series are rows b. Use UC for cells and LC for doubles
UC/LC: Upper and Lower Case x = cell2mat(X), t = cell2mat(T)
Don't use X for noise. n = rand(1,N);
PROBLEM: NNTOOLBOX based on ROW variables. XCORR appears to operate on columns.
[ Rnnp, nlags] = xcorr(n','coeff') % p for "prime'
[ Rttp, tlags ] = xcorr( t','coeff')
Rnn = Rnnp'; Rtt=Rttp';
absRnn is a ROW which is sorted using sort, NOT sortrow to obtain CL95
absRtt is a ROW which is thresholded to obtain the significant lags
The function FIND can be used to obtain the significant lags.
t Autocorrelation feedback lags are positive ( narnet, narxnet)
x/t Crosscorrelation input lags are nonnegative (timedelaynet, narxnet)
1. The best of multiple designs is chosen by tr.best_vperf !
2. The UNBIASED estimate of net performance on unseen data is obtained from the value of tr.best_tperf obtained from the net chosen in 1.
% I don’t understand the reasoning here: if the unbiased estimate of net performance is acquired from tr.best_tperf, why not chose the best of multiple designs directly from that parameter instead of tr.best_vperf?
If the best net is chosen based on tperf, then the estimate for unseen data is biased.
To choose nets for deployment. I typically
1. Choose all nets with nontraining val and test performance exceeding a threshold.
2. Choose the ones with the smallest number of hidden nodes.
3. If the val and test performances are significantly worse than the training performance,
continue training with ALL of the data using dividetrain.
Hope this helps.
Greg

4 Comments

I think I got the significant lags to work now, I looped though all of them and for the first time ever my closed loop predictions didn’t result in a completely straight line but gave me very nice looking non-linear results, so thanks, that felt great! (The predictions still weren’t very accurate though). I only have one more question concerning the lags:
The amount of lags that are significant is quite high, many hundreds even when I start to increase the length of the input data series. And I’ve noticed that you say you try a “subset” of the lags, which I guess means that you don’t loop though them all? And in that case is there any sophisticated way of knowing which to try or do you simply skip say 2 out of 3 in the loop?
And after reading some of your posts in the newsgroup I’m now trying to inplement a code that can try a variation of different number of hidden nodes and random weights. I find some of your tutorials in the newsgroup a little bit cryptic and difficult to follow to be honest but this is what I have managed to scrape together with my understanding so far:
hMax=5; %Number of different hidden nodes that will be tested
Ntrials=10 %Number of different loops with random weights that will be tested
for h=1:1:hMax
net=fitnet(h); %Adjusts the size of the net so that it has h number of hidden nodes?
for i = 1:1:Ntrials
s = rng; %Generates new set of random weights?
net = configure(net,T); %Needs to be called in order to assign the weights to the net?
[ net tr Ys Es Af Xf ] = train( net, Xs, Ts, Xsi, Asi); %Trains NN with node and weight settings.
StoredWeightsSettings(1:length(getwb(net)),i,h)=getwb(net); %Stores info about weights used.
NodeAndWeightPerformance(h,i)=tr.best_tperf; %Stores information about test performance of net.
end
end
Is this a correct way of doing it?
I was thinking that the weights from each run could be stored inside a matrix and when the loop is complete and the best net is chosen, the initial weights of the net that will be retrained could be taken from there. But is it possible to manually assign weights like that? Is there a reverse function to getwb that writes weights instead of reads them?
>I think I got the significant lags to work now, I looped though all of them .. you say you try a “subset” of the lags, ... you don’t loop though them all? And in that case is there any sophisticated way of knowing which to try or do you simply skip say 2 out of 3 in the loop?
N = ? number of sig lags = ? Explain "loop through".
I just take the first m siglags and try to minimize m. Notice that even if the siglags are not consecutive, (e.g, [ 2 4 6] ) the length of the lag buffer only depends on the maximum lag.
> I’m now trying to inplement a code that can try a variation of Different number of hidden nodes and random weights. ... this is ...my understanding so far: hMax=5; %Number of different hidden nodes that will be tested Ntrials=10 %Number of different loops with random weights that will be tested
I try to minimize H subject to the constraints
H is in Hmin:dH:Hmax <= Hub (Ntrneq >= Nw)
MSEgoal = 0.01*Ndof*MSE00a/Ntrneq % R2trna >= 0.99
MinGrad = MSEgoal/100
If Hmax is large, Hmin and dH are not necessarily 1
rng('default')% Initialize the rng to your favorite state before the outer loop
s(i,j) = rng % Store the states of the rng inside the inner loop. Then the 100-200 candidate nets and/or their thousands of weights don't have to be stored
The reverse of getwb is setwb ... but you could have found that out from the help or doc documentation (;>})
Hope this helps.
Greg
N = ? number of sig lags = ? Explain "loop through".
Since the documentation example configures the feedback delays as net = narnet(1:2,10); I was under the impression that the lags were always supposed to be written in that manner (1 to nr of lags). So by looping though I literally meant:
Siglags=[2 4 6]; %if this is the significant lags you have
%First try defining the net as this in a loop:
net = narnet(1:Siglags(1), HiddenLayerSize);
%then try training with:
net = narnet(1:Siglags(2), HiddenLayerSize);
%then lastly:
net = narnet(1:Siglags(3), HiddenLayerSize);
But judging by your subtle skepticism, this clearly isn’t how it’s supposed to be done? Is the whole vector of Siglags supposed to be fed into the net all at once like: net = narnet(Siglags, HiddenLayerSize); ?
When you say you take the first m siglags and try to minimize m, what do you mean by m?
And regarding the hidden nodes, when you say Hmin:dH:Hmax <= Hub, what is your definition of the variable “Hub”?
1. Incorrect. use
Siglags(1:m).
1:Siglags(m) can include intermediate lags that are not significant.
2. I choose m by nonsystematic trial and error.
3. Again, to avoid overfitting, I try to minimize m.
4. Did it ever occur to you to search in NEWSGROUP or ANSWERS using
greg Hub
Greg

Sign in to comment.

Asked:

on 21 Apr 2015

Commented:

on 13 Oct 2015

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!