⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wnetarx.m

📁 新的神经网络算法源程序
💻 M
字号:
function [th, mseif, flopif, timeif] = ...         wnetarx(yu, nn, nbwavelon, max_epoch, initmode, min_nbw, levels)%Wnetarx: Compute nonlinear ARX models using WaveNet%% THETA = wnetarx(Z, nn, nbwavelon, max_epoch, initmode, min_nbw, levels)%% THETA: returned as the estimated parameters of the WaveNet-ARX model% Z : the output-input data Z=[y u], with y and u as column vectors.%     For multi-input systems Z=[y u1 u2 .. um]. For time series Z=y only.% nn: nn = [na nb nk], the orders and delays. For a time series, nn=na only.%% nbwavelon: number of wavelets used to construct the WaveNet% max_epoch: maximum number of epochs of training% initmode: Initialization mode, default is 2%             initmode=1:  residual based selection%             initmode=2:  stepwise selection by orthogonalization%             initmode=3:  backward elimination%           If initmode=THETA, a matrix containing WaveNet parameters,%           then these parameters are used to initialize the WaveNet.%           This mode is useful for retrain WaveNets.%% min_nbw: minimum number of input patterns each wavelon should "cover"% levels: number of scale levels scanned during initialization%%The arguments min_nbw and levels are optional.%By Qinghua Zhang. March, 1994.if nargin < 3, nbwavelon = []; end;if nargin < 4, max_epoch = []; end;if nargin < 5, initmode = []; end;if nargin < 6, min_nbw = []; end;if nargin < 7, levels = []; end;if length(initmode) > 1  [t0,d0,w0,c0,b0, nn]=decompth(initmode); nbwavelon=length(w0);  initmode = 0;else  t0=[]; d0=[]; w0=[]; c0=[]; b0=[];end% Generate the regression matrix [y, x] = io2reg(yu, nn);[t,d,w,c,b, mseif, flopif, timeif] = trainwn(x', y', nbwavelon, max_epoch, ...              initmode, min_nbw, levels, t0, d0, w0, c0, b0);nbwavelon = length(w);nbvar = length(c);thr = 2*nbvar + 5;nnlen = size(nn,2);thc = max([3+nnlen nbwavelon  nbvar+1 7]);th = zeros(thr, thc);th(1,1:(3+nnlen)) = [nbwavelon nbvar nnlen nn];if nbwavelon>0  th(2:nbvar+1,1:nbwavelon) = t;  th(nbvar+2:2*nbvar+1,1:nbwavelon) = d;  th(2*nbvar+2,1:nbwavelon) = w;endth(2*nbvar+3, 1:nbvar) = c;th(2*nbvar+3, nbvar+1) = b;th(2*nbvar+4, 1:6) = clock;th(2*nbvar+5,1:7) = abs('WNETARX');

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -