Using the Neural Network Time Series Tool
Short Description
This is how to use neural network time series tool in matlab...
Description
Using the Neural Network Time Series Tool Tool 1. If nee neede ded, d, op open en th the e Neu Neural ral Ne Netw twork ork St Start art GU GUII wit with h thi this s com comman mand: d: 2.nnstart
3.
Click Time Series Tool to Tool to open ope n the Neural Network Time Series Tool. Tool. !ou !o u can also use the commandntstool."
•
•
Notice that this openin# pane is different than the openin# panes for the other GUIs. This is $ecause ntstoolcan $e used to sol%e three different kinds of time series pro$lems. In the first t&pe of time series pro$lem, &ou would like to predict future %alues of a time series y t " from past %alues of that time series and past %alues of a second time series x series x t ". ". This form of prediction is called nonlinear autore#ressi%e with e'o#enous e'ternal" input, or N()* see +N()* Network+ nar'net, Network+ nar'net, closeloop"", and can $e written as follows: y t " f y t - 1", ..., y t - d ", x ", x t - 1", ..., t t - d "" "" This model could $e used to predict future %alues of a stock or $ond, $ased on such economic %aria$les as unemplo&ment une mplo&ment rates, G/, etc. It could also $e used for s&stem identification, in which models are de%eloped to represent d&namic s&stems, such as chemical processes, manufacturin# s&stems, ro$otics, aerospace %ehicles, etc. In the second t&pe of time series pro$lem, there is onl& one series in%ol%ed. The future %alues of a time series y t " are predicted onl& from past %alues of that series. This form of prediction is called nonlinear autore#ressi%e, or N(), and can $e written as follows: y t " f y t - 1", ..., y t - d "" ""
This model could also $e used to predict financial instruments, $ut without the use of a companion series. The third time series pro$lem is similar to the first t&pe, in that two series are in%ol%ed, an input series x t " and an output0tar#et series y t ". ere &ou want to predict %alues of y t " from pre%ious %alues of x t ", $ut without knowled#e of pre%ious %alues of y t ". This input0output model can $e written as follows: y t " f x t - 1", ..., x t - d "" The N()* model will pro%ide $etter predictions than this input2output model, $ecause it uses the additional information contained in the pre%ious %alues of y t ". owe%er, there ma& $e some applications in which the pre%ious %alues of y t " would not $e a%aila$le. Those are the onl& cases where &ou would want to use the input2output model instead of the N()* model. . 4or this e'ample, select the N()* model and click Next to proceed. •
5.
Click Load Example Data Set in the Select ata window. The Time Series ata Set Chooser window opens. Note Use the Inputs and Targets options in the Select Data window when you need to load data from the MATLAB ® workspace.
6.
7.
Select pH Neutralization Process, and click Import. This returns &ou to the Select ata window. 8. Click Next to open the 9alidation and Test ata window, shown in the followin# fi#ure. The %alidation and test data sets are each set to 15 of the ori#inal data.
;ith these settin#s, the input %ectors and tar#et %ectors will $e randoml& di%ided into three sets as follows: • •
•
7 ) Pre!ict $ne Step Ahea!>7+ /=. viewnets4 /C. 6xs3xis3ais3ts7 * preparetsnets3inputSeries3 893targetSeries4+ /;. "s * netsxs3xis3ais4+ /D. earl"Pre!ictPer&ormance * per&ormnets3ts3"s4 /. earl"Pre!ictPer&ormance * =1. =.
1.11/2
=2.
4rom this fi#ure, &ou can see that the network is identical to the pre%ious open2loop network, e'cept that one dela& has $een remo%ed from each of the tapped dela& lines. The output of the network is then y t J 1" instead of y t ". This ma& sometimes $e helpful when a network is deplo&ed for certain applications. If the network performance is not satisfactor&, &ou could tr& an& of these approaches: •
• • •
•
•
•
)eset the initial network wei#hts and $iases to new %alues with init and train a#ain see +Initiali=in# ;ei#hts+init"". Increase the num$er of hidden neurons or the num$er of dela&s. Increase the num$er of trainin# %ectors. Increase the num$er of input %alues, if more rele%ant information is a%aila$le. Tr& a different trainin# al#orithm see +Trainin# (l#orithms+". To #et more e'perience in command2line operations, tr& some of these tasks: urin# trainin#, open a plot window such as the error correlation plot", and watch it animate. /lot from the command line with functions such as plotresponse, ploterrcorr and plotper&orm. 4or more information on usin# these functions, see their reference pa#es." (lso, see the ad%anced script for more options, when trainin# from the command line. Kach time a neural network is trained, can result in a different solution due to different initial wei#ht and $ias %alues and different di%isions of data into
trainin#, %alidation, and test sets. (s a result, different neural networks trained on the same pro$lem can #i%e different outputs for the same input. To ensure that a neural network of #ood accurac& has $een found, retrain se%eral times. There are se%eral other techni?ues for impro%in# upon initial solutions if hi#her accurac& is desired. 4or more information, see Impro%e Neural Network Generali=ation and (%oid %erfittin#.
View more...
Comments