The code is from the book Mathematical Modeling Algorithms and Applications mostly by typing given that we have the official resource download link http://www.ndip.cn/download_list/columnsId=7&FrontColumns_navigation01-1389769857789FirstColumnId=7&downloadcategoryid=2.html. The original MATLAB code provided by the authors is purported to be checked, but the LINGO code is not, and relatively the code is not very neat. Besides, some of the code snippets that are not classified under any example problems or exercises are missing. However, all of the code in this repository has been successfully compiled except those with missing data, and the corresponding Lingo reports (*.lgr) are also provided. In fact, while writing and compiling the original MATLAB code on the book, there are many errors and warnings given by the MATLAB compiler. For example, there should not be any semicolon at the end of the sentence that declares a MATLAB function. All of them have been corrected. Some of them need not be repaired, such as canceling output in the command line by adding a semicolon at the end of sentences.
In this repository, we use "E" for example code, "S" for solution code, "C" for independent code on the main book.
Note that E4_21 and S4_1 gives different results from that on the book. E8_11 and S8_5 have the same error: "The value of 'res' is invalid. Expected residual series to be one of these types: double. Instead its type was iddata". S8_6_1 has the error: "Undefined operator '.^' for input arguments of type 'iddata'". For these kinds of error, we can just use res.OutputData instead of res to take lbqtest. Besides, we can use [p,q]=find(myaic==min(min(myaic))) to avoid inputs and automatically give the appropriate p and q values for ARMAX models.