www.pudn.com > kicILC-control.rar > kicr_regssion_demo.m, change:2012-06-12,size:1206b


% KICR  by nizhizhen 2012.4 
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
clear; 
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
%data set 
%[sig,x]=demosig();ikii 
%load('bodyfat.mat'); 
load('NonlinearData.mat'); 
 
N_train=50;      % the number of  train sample  
N_validate=30; 
N_test=50; 
 
 
M=size(X,1);      % the number of  variable 
 
x_train=X(:,1:N_train); 
x_validate=X(:,N_train+1:N_train+N_validate); 
x_test=X(:,N_train+N_validate+1:N_train+N_validate+N_test); 
y_train=Y(:,1:N_train); 
y_validate=Y(:,N_train+1:N_train+N_validate); 
y_test=Y(:,N_train+N_validate+1:N_train+N_validate+N_test); 
 
[ y_test_predict,MSE_validate,rbf_var ] = dynamic_kicr( x_train,y_train,x_validate,y_validate,x_test); 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
%show 
RMSE_test=norm(y_test_predict-y_test)/sqrt(size(y_test,2));%RMSE 
[~,~,residuals]=regress(y_test.',y_test_predict.'); 
figure(2) 
icaplot('compare',y_test,1,y_test_predict,1,0,0, '预测精度曲线', '真实值', '预测值'); 
hold on ;plot(residuals.');legend('Actual','Predicted','Residuals');hold off; 
 
plotregression(y_test,y_test_predict);