Rbf prediction of chaotic time series

Based on the method of neural network prediction of chaotic time series, the working principle of neural network is analyzed, and the logistic equation data generated by simulation and the actual collected sea clutter data are analyzed.

The radial basis function (RBF) neural network is applied to the prediction of chaotic time series, and a three-layer RBF network structure is designed. For three typical chaotic systems, under different noise levels, the RBF network model is used to predict separately the study.

clc
clear
close all

%------------------------------------------------- -
% Public parameter
k1 = 6000;% number of iteration points in the front
k2 = 2000;% number of iteration points in the back (total number of samples)

%------------------------------------------------- -
% Generate chaotic sequence
% dx/dt = sigma*(yx)
% dy/dt = r*x-y-x*z
% dz/dt = -b*z + x*y

sigma = 16;% Lorenz equation parameter a
b = 4;% b
r = 45.92;% c            

y = [-1,0,1];% starting point (1 x 3 row vector)
h = 0.01;% integration time step

k1 = 30000;% previous iteration points
k2 = 6000;% subsequent iteration points

z = LorenzData(y,h,k1+k2,sigma,r,b);
X = z(k1+1:end,1);% time series
        
%-------------- ------------------------------------

X = normalize_a(X,1);% signal is normalized to mean 0 and amplitude is 1
tau = 1;% delay
m = 3;% embedding dimension

%--------------------------------------------------

train_num = 500% number of training samples
test_num = 1500% number of test samples

%------------------------------------------------- -
% Phase space reconstruction of chaotic sequence (phase space reconstruction)

x_train = X(1:train_num);
x_test =  X(train_num+1:train_num+test_num);

[xn_train,dn_train] = PhaSpaRecon(x_train,tau,m);
[xn_test,dn_test] = PhaSpaRecon(x_test,tau,m);

%------------------------------------------------- -----
    
% The number of neurons is the number of training samples
P = xn_train;
T = dn_train;
spread = 10% The larger the value, the larger the value of the covered function (default is 1)
net = newrbe(P,T, spread);

err1 = sim(net,xn_train)-dn_train;
err_mse1 = mean(err1.^2);
Perr1 = err_mse1/var(X)

dn_pred = sim(net,xn_test);
err2 = dn_pred-dn_test;
err_mse2 = mean(err2.^2);
Perr2 = err_mse2/var(X)

%------------------------------------------------------

figure;
subplot(211);
plot(1:length(err2),dn_test,'r+:',1:length(err2),dn_pred,'bo-');
title('true value (+) and predicted value ( o)')
subplot(212);
plot(err2,'k');
title('Absolute prediction error')

Guess you like

Origin blog.csdn.net/ccsss22/article/details/114067472