NARXnet non-integer delays problem

3 views (last 30 days)
I have read quite a bit on the crosscorr and autocorr and nncorr
I just dont get what this statement means:
Use the significant lags of the target autocorrelation function and the target/input crosscorrelation function to determine ID and FD.
could you please explain further?
From the code below, 1. What does the value 35 mean? 2. Do i just use the values: inputdelays and feedackdelays and input them straight into the net like this?:
net = narxnet( inputdelays , feedbackdelays ,hiddenLayerSize,'open',trainFcn)
...............
The delays were gotten with this code
x = OilRate; % 1×1500 cell
t = GasProduced; % 1×1500 cell
X = zscore(cell2mat(x));
T = zscore(cell2mat(t));
[ I N ] = size(X)
[ O N ] = size(T)
crosscorrXT = nncorr(X,T,N-1);
autocorrT = nncorr(T,T,N-1);
crosscorrXT(1:N-1) = []; % Delete negative delays
autocorrT(1:N-1) = [];
sigthresh95 = 0.21 % Significance threshold
sigcrossind = crosscorrXT( crosscorrXT >= sigthresh95 )
sigautoind = autocorrT( autocorrT >= sigthresh95 )
inputdelays = sigcrossind(sigcrossind <= 35)
feedbackdelays = sigautoind(sigautoind <= 35)
feedbackdelays(1)=[] % Delete zero delay
2. When I run the code above I get inputdelays(1×200 double) and fedbackdelays(1×154 double)
When I try to use this in my NARXnet code I get this error:
Parameters.InputDelays contains a non integer value
Which is true since
inputdelays has Min: 0.2181 & Max:0.5974
feedbackdelays has Min: 0.2103 Max:0.8725
How do I resolve this?

Accepted Answer

Greg Heath
Greg Heath on 28 May 2015
% NARXnet non-integer delays problem
% Asked by Olumide Oladoyin on 22 May 2015 at 13:09
% I have read quite a bit on the crosscorr and autocorr and nncorr
% I just dont get what this statement means: Use the significant lags of
% the target autocorrelation function and the target/input crosscorrelation
% function to determine ID and FD. could you please explain further?
I am not a statistician. Therefore, if you need the explanation to be precise, find a statistics text or reference. For example, search using Wikipedia and/or Google using the term "significant correlations".
At certain lags the magnitude of the correlation between two time functions exceeds that expected from two uncorrelated functions.
To quantify the concept, estimate the cumulative probability of the absolute value of the correlation coefficient between two independent Gaussian noise samples of length N. Choose a significant probability level, e.g., 95%. and the corresponding correlation value sigthresh95. This threshold value depends on N.
The absolute value of the correlation coefficient, at lag m, between two time functions of length N ls considered significant if it is greater or equal to sigthresh95. The lag values for which this occurrs are called significant lags.
For time-series prediction I just use trial and error to choose a subset of the smaller significant lags. However, there are more exact selection methods using "partial correlations". See a stats reference for more detail.
I'm not sure if the following command line references will help:
>> lookfor 'partial correlation'
partialcorr - Linear or rank partial correlation coefficients.
partialcorri - Partial correlation coefficients with internal adjustments.
Use the help and doc commands for details.
% From the code below, 1. What does the value 35 mean?
I have no idea. It could stand for the 35th value in the cumulative probability ditribution.
% 2. Do i just use the values: inputdelays and feedackdelays and input them straight into the net like this?:
% net = narxnet( inputdelays , feedbackdelays , hiddenLayerSize, 'open', trainFcn) ...............
As I said previously, I just choose a subset using trial and error.
% The delays were gotten with this code
%
% x = OilRate; % 1×1500 cell
% t = GasProduced; % 1×1500 cell
% X = zscore(cell2mat(x));
% T = zscore(cell2mat(t));
% [ I N ] = size(X)
% [ O N ] = size(T)
% crosscorrXT = nncorr(X,T,N-1);
% autocorrT = nncorr(T,T,N-1);
% crosscorrXT(1:N-1) = []; % Delete negative delays
% autocorrT(1:N-1) = [];
%
% sigthresh95 = 0.21 % Significance threshold
Incorrect value for N = 1500
% sigcrossind = crosscorrXT( crosscorrXT >= sigthresh95 )
% sigautoind = autocorrT( autocorrT >= sigthresh95 )
% inputdelays = sigcrossind(sigcrossind <= 35)
% feedbackdelays = sigautoind(sigautoind <= 35)
% feedbackdelays(1)=[] % Delete zero delay
Incorrect. You are confusing correlation values and delay values
Hope this helps.
Thank you for formally acepting my answer
Greg

More Answers (0)

Categories

Find more on Sequence and Numeric Feature Data Workflows in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!