我想提前7天预测地表水的BOD(生化需氧量)。我的样本大小只有18.我在MATLAB中使用if(some condition) {
String message = "Time to leave earth";
System.out.println(message); // this will pass compilation since message
// is guaranteed to be found in this scope
}
System.out.println(message); // this won't pass compilation, since message is not
// found in this scope
进行工作。
以下是示例输入:
narnet
以下是代码:
输入:
(0.9000 0.4774 0.8849 0.1000 0.6797 0.1000 0.9000 0.2721 0.1444
0.1978 0.5444 0.4111 0.9000 0.1755 0.3566 0.3868 0.6585 0.8094)
输出
clc,clear;
plt=0;
T=load('BOD test.txt');
L=length(T);
net=narnet(1:.1,10);
view(net),
[Xs,Xsi,Asi,Ts] = preparets( net, {}, {}, T );
ts = cell2mat(Ts);
plt = plt+1; figure(plt), hold on
plot( 1:L, ts, 'LineWidth', 2 )
rng( 'default' )
[net, tr, Ys, Es, Af, Xf] = train( net, Xs, Ts, Xsi, Asi );
view( net )
NMSEs = mse( Es ) /var( ts,1 )
ys = cell2mat( Ys );
plot( 1:L, ys, 'ro', 'LineWidth', 2 )
axis( [ 0 22 0 1.3 ] )
legend( 'TARGET', 'OUTPUT' )
title( 'OPENLOOP NARNET RESULTS')
[ netc Xci Aci ] = closeloop(net,Xsi,Asi);
view(netc)
[Xc,Xci,Aci,Tc] = preparets(netc,{},{},T);
[ Yc Xcf Acf ] = netc(Xc,Xci,Aci);
Ec = gsubtract(Tc,Yc);
yc = cell2mat(Yc);
tc = ts;
NMSEc = mse(Ec) /var(tc,1)
为什么NMSE的值显示为1?这是'Openloop narnet结果'的曲线图 : Openloop narnet results
输入和输出有什么问题?我是MATLAB的新手。所以必须给予亲切的帮助。