home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume16 / nlmdl / part02 < prev    next >
Encoding:
Internet Message Format  |  1991-01-12  |  51.1 KB

  1. From: arg@ccvr1.cc.ncsu.edu (Ron Gallant)
  2. Newsgroups: comp.sources.misc
  3. Subject: v16i064:  nlmdl - Estimate nonlinear statistical models, Part02/06
  4. Message-ID: <1991Jan12.050546.8628@sparky.IMD.Sterling.COM>
  5. Date: 12 Jan 91 05:05:46 GMT
  6. Approved: kent@sparky.imd.sterling.com
  7. X-Checksum-Snefru: 6f34cb32 6a1e6f5f 64181494 7c1cfcab
  8.  
  9. Submitted-by: arg@ccvr1.cc.ncsu.edu (Ron Gallant)
  10. Posting-number: Volume 16, Issue 64
  11. Archive-name: nlmdl/part02
  12.  
  13. # This is a shell archive.  Remove anything before this line, then unpack
  14. # it by saving it into a file and typing "sh file".  To overwrite existing
  15. # files, type "sh file -c".  You can also feed this as standard input via
  16. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  17. # will see the following message at the end:
  18. #        "End of archive 2 (of 6)."
  19. # Contents:  ch5eg1/detail.bak ch5eg1/end3l.bak ch5eg1/ending.bak
  20. #   ch6eg1/ending.bak ch6eg2/detail3l.bak display.cc nlmdl.h realmat.h
  21. # Wrapped by arg@sparc on Fri Jan 11 20:14:53 1991
  22. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  23. if test -f 'ch5eg1/detail.bak' -a "${1}" != "-c" ; then 
  24.   echo shar: Will not clobber existing file \"'ch5eg1/detail.bak'\"
  25. else
  26. echo shar: Extracting \"'ch5eg1/detail.bak'\" \(5719 characters\)
  27. sed "s/^X//" >'ch5eg1/detail.bak' <<'END_OF_FILE'
  28. XMissing observation at t = 142.
  29. XMissing observation at t = 170.
  30. XMissing observation at t = 172.
  31. XMissing observation at t = 193.
  32. XWarning, status::to, var is not initialized, tmp.dat incomplete.
  33. X
  34. X
  35. X     **********************************************************************
  36. X     *                                                                    *
  37. X     *                             nlmdl 2.0                              *
  38. X     *                                                                    *
  39. X     **********************************************************************
  40. X
  41. X
  42. X     **********************************************************************
  43. X     *                                                                    *
  44. X     *                         Parameter settings                         *
  45. X     *                                                                    *
  46. X     **********************************************************************
  47. X
  48. X     Gallant, "Nonlinear Statistical Models," Chapter 5, Figure 3, p. 324-326
  49. X     SUR                What estimation method?  Code SUR, TSLS, or GMM.
  50. X     224                Number of observations, t = 1, ..., n.
  51. X     2                  Number of equations, i.e. dimension of e.
  52. X     0                  Number of instruments, i.e. dimension of Z.
  53. X     8                  Number of parameters, i.e. dimension of theta.
  54. X     50                 Upper limit on Gauss-Newton iterations.
  55. X     1                  Number var iterates, ivar=0 means none.
  56. X     homoskedastic      Code homoskedastic or heteroskedastic.
  57. X     0                  Number of moving average terms MA for var estimate.
  58. X     none               Code none or Parzen, none when MA>0 is unwise.
  59. X     1.000000e-13       Convergence tolerance, tol=1.0e-8 is reasonable.
  60. X     1.000000e-10       Inversion tolerance, eps=1.0e-13 is reasonable
  61. X     minimal            How much output?  Code none, minimal, or full.
  62. X
  63. X
  64. X     **********************************************************************
  65. X     *                                                                    *
  66. X     *                           Starting theta                           *
  67. X     *                                                                    *
  68. X     **********************************************************************
  69. X                                           Col  1
  70. X                               Row  1    -2.90000
  71. X                               Row  2    -1.30000
  72. X                               Row  3    0.820000
  73. X                               Row  4    0.360000
  74. X                               Row  5    -1.50000
  75. X                               Row  6    -1.00000
  76. X                               Row  7  -0.0300000
  77. X                               Row  8   -0.470000
  78. X
  79. X
  80. X     **********************************************************************
  81. X     *                                                                    *
  82. X     *                               theta                                *
  83. X     *                                                                    *
  84. X     **********************************************************************
  85. X                                           Col  1
  86. X                               Row  1    -2.92458
  87. X                               Row  2    -1.28675
  88. X                               Row  3    0.818570
  89. X                               Row  4    0.361158
  90. X                               Row  5    -1.53759
  91. X                               Row  6    -1.04896
  92. X                               Row  7   0.0300867
  93. X                               Row  8   -0.467420
  94. X
  95. X
  96. X
  97. X     **********************************************************************
  98. X     *                                                                    *
  99. X     *                                var                                 *
  100. X     *                (no degrees of freedom corrections)                 *
  101. X     *                                                                    *
  102. X     **********************************************************************
  103. X                                     Col  1      Col  2
  104. X                         Row  1    0.164925   0.0920057
  105. X                         Row  2   0.0920057   0.0896426
  106. X
  107. X
  108. X
  109. X     **********************************************************************
  110. X     *                                                                    *
  111. X     *                                 V                                  *
  112. X     *                             (rank = 8)                             *
  113. X     *                                                                    *
  114. X     **********************************************************************
  115. X             Col  1      Col  2      Col  3      Col  4      Col  5      Col  6
  116. X Row  1   0.0760485  -0.0394416 -0.00813632  0.00225515   0.0151611 -0.00086387
  117. X Row  2  -0.0394416   0.0506098  0.00219396  0.00071347 -0.00244522   0.0122632
  118. X Row  3 -0.00813632  0.00219396  0.00644155  0.00078138 -0.00603532 -0.00238599
  119. X Row  4  0.00225515  0.00071347  0.00078138  0.00090344 -0.00048087  0.00101291
  120. X Row  5   0.0151611 -0.00244522 -0.00603532 -0.00048087  0.00832137  0.00200847
  121. X Row  6 -0.00086387   0.0122632 -0.00238599  0.00101291  0.00200847  0.00689444
  122. X Row  7 -0.00293607  0.00321764 -0.00075345 -0.00079074  0.00110681  0.00015596
  123. X Row  8 -0.00218205  0.00172663  0.00080830  0.00027549 -0.00115374  0.00049917
  124. X             Col  7      Col  8
  125. X Row  1 -0.00293607 -0.00218205
  126. X Row  2  0.00321764  0.00172663
  127. X Row  3 -0.00075345  0.00080830
  128. X Row  4 -0.00079074  0.00027549
  129. X Row  5  0.00110681 -0.00115374
  130. X Row  6  0.00015596  0.00049917
  131. X Row  7  0.00128616 -0.00024276
  132. X Row  8 -0.00024276  0.00036532
  133. X
  134. END_OF_FILE
  135. if test 5719 -ne `wc -c <'ch5eg1/detail.bak'`; then
  136.     echo shar: \"'ch5eg1/detail.bak'\" unpacked with wrong size!
  137. fi
  138. # end of 'ch5eg1/detail.bak'
  139. fi
  140. if test -f 'ch5eg1/end3l.bak' -a "${1}" != "-c" ; then 
  141.   echo shar: Will not clobber existing file \"'ch5eg1/end3l.bak'\"
  142. else
  143. echo shar: Extracting \"'ch5eg1/end3l.bak'\" \(5775 characters\)
  144. sed "s/^X//" >'ch5eg1/end3l.bak' <<'END_OF_FILE'
  145. XGallant, "Nonlinear Statistical Models," Chapter 5, Figure 3, p. 324-326
  146. XSUR                What estimation method?  Code SUR, TSLS, or GMM.
  147. X224                Number of observations, t = 1, ..., n.
  148. X2                  Number of equations, i.e. dimension of e.
  149. X0                  Number of instruments, i.e. dimension of Z.
  150. X8                  Number of parameters, i.e. dimension of theta.
  151. X50                 Upper limit on Gauss-Newton iterations.
  152. X1                  Number var iterates, ivar=0 means none.
  153. Xheteroskedastic    Code homoskedastic or heteroskedastic.
  154. X3                  Number of moving average terms MA for var estimate.
  155. XParzen             Code none or Parzen, none when MA>0 is unwise.
  156. X1.000000e-13       Convergence tolerance, tol=1.0e-8 is reasonable.
  157. X1.000000e-10       Inversion tolerance, eps=1.0e-13 is reasonable
  158. Xfull               How much output?  Code none, minimal, or full.
  159. X8                  Computed rank of V.
  160. Xuncorrected        Divisor of var, corrected or uncorrected.
  161. X                   Blank line.
  162. X                   Blank line.
  163. X                   Blank line.
  164. X  -2.9245814501616803e+00          -2.92458145  theta(1)
  165. X  -1.2867460434063589e+00          -1.28674604  theta(2)
  166. X   8.1856990357452608e-01           0.81856990  theta(3)
  167. X   3.6115785200404138e-01           0.36115785  theta(4)
  168. X  -1.5375885808695555e+00          -1.53758858  theta(5)
  169. X  -1.0489590970263374e+00          -1.04895910  theta(6)
  170. X   3.0086700241162653e-02           0.03008670  theta(7)
  171. X  -4.6742011797582117e-01          -0.46742012  theta(8)
  172. X   1.6492462994112111e-01           0.16492463  var(1,1)
  173. X   9.2005729031321579e-02           0.09200573  var(2,1)
  174. X   9.2005729031321579e-02           0.09200573  var(1,2)
  175. X   8.9642642316875812e-02           0.08964264  var(2,2)
  176. X   6.4151871786190293e-02           0.06415187  V(1,1)
  177. X  -2.6808435093990508e-02          -0.02680844  V(2,1)
  178. X  -1.0481302083617307e-02          -0.01048130  V(3,1)
  179. X   2.4179792658493493e-03           0.00241798  V(4,1)
  180. X   1.5271744257123141e-02           0.01527174  V(5,1)
  181. X   3.6217216495842341e-03           0.00362172  V(6,1)
  182. X  -2.2745052058113957e-03          -0.00227451  V(7,1)
  183. X  -2.2282353784641093e-03          -0.00222824  V(8,1)
  184. X  -2.6808435093990942e-02          -0.02680844  V(1,2)
  185. X   3.9204445770723149e-02           0.03920445  V(2,2)
  186. X   3.5239211150354388e-03           0.00352392  V(3,2)
  187. X   1.9044116642894958e-03           0.00190441  V(4,2)
  188. X  -2.5090660931227499e-03          -0.00250907  V(5,2)
  189. X   9.9860387081928022e-03           0.00998604  V(6,2)
  190. X   1.0763522857786497e-03           0.00107635  V(7,2)
  191. X   1.4608657346846976e-03           0.00146087  V(8,2)
  192. X  -1.0481302083617045e-02          -0.01048130  V(1,3)
  193. X   3.5239211150353313e-03           0.00352392  V(2,3)
  194. X   5.9499339084749959e-03           0.00594993  V(3,3)
  195. X   3.8379282539160748e-04           0.00038379  V(4,3)
  196. X  -5.5488697133901426e-03          -0.00554887  V(5,3)
  197. X  -2.3181283618853221e-03          -0.00231813  V(6,3)
  198. X  -3.0995472128008387e-04          -0.00030995  V(7,3)
  199. X   7.9619528555448433e-04           0.00079620  V(8,3)
  200. X   2.4179792658493345e-03           0.00241798  V(1,4)
  201. X   1.9044116642895203e-03           0.00190441  V(2,4)
  202. X   3.8379282539158981e-04           0.00038379  V(3,4)
  203. X   1.1185997609060533e-03           0.00111860  V(4,4)
  204. X  -8.2948235409772357e-05          -0.00008295  V(5,4)
  205. X   1.8128096548391446e-03           0.00181281  V(6,4)
  206. X  -8.6907934492451726e-04          -0.00086908  V(7,4)
  207. X   2.3704685064746336e-04           0.00023705  V(8,4)
  208. X   1.5271744257122990e-02           0.01527174  V(1,5)
  209. X  -2.5090660931226623e-03          -0.00250907  V(2,5)
  210. X  -5.5488697133901886e-03          -0.00554887  V(3,5)
  211. X  -8.2948235409779458e-05          -0.00008295  V(4,5)
  212. X   7.2303542854823596e-03           0.00723035  V(5,5)
  213. X   2.4292056516279819e-03           0.00242921  V(6,5)
  214. X   6.6272949286796750e-04           0.00066273  V(7,5)
  215. X  -1.0628753376875112e-03          -0.00106288  V(8,5)
  216. X   3.6217216495840446e-03           0.00362172  V(1,6)
  217. X   9.9860387081929288e-03           0.00998604  V(2,6)
  218. X  -2.3181283618853659e-03          -0.00231813  V(3,6)
  219. X   1.8128096548391255e-03           0.00181281  V(4,6)
  220. X   2.4292056516280035e-03           0.00242921  V(5,6)
  221. X   6.9725212588786700e-03           0.00697252  V(6,6)
  222. X  -8.0090995756335992e-04          -0.00080091  V(7,6)
  223. X   2.8957023926462434e-04           0.00028957  V(8,6)
  224. X  -2.2745052058114465e-03          -0.00227451  V(1,7)
  225. X   1.0763522857786777e-03           0.00107635  V(2,7)
  226. X  -3.0995472128007016e-04          -0.00030995  V(3,7)
  227. X  -8.6907934492452008e-04          -0.00086908  V(4,7)
  228. X   6.6272949286796273e-04           0.00066273  V(5,7)
  229. X  -8.0090995756337260e-04          -0.00080091  V(6,7)
  230. X   1.1126181202496821e-03           0.00111262  V(7,7)
  231. X  -2.5799316642020757e-04          -0.00025799  V(8,7)
  232. X  -2.2282353784641279e-03          -0.00222824  V(1,8)
  233. X   1.4608657346847011e-03           0.00146087  V(2,8)
  234. X   7.9619528555449908e-04           0.00079620  V(3,8)
  235. X   2.3704685064746418e-04           0.00023705  V(4,8)
  236. X  -1.0628753376875236e-03          -0.00106288  V(5,8)
  237. X   2.8957023926462423e-04           0.00028957  V(6,8)
  238. X  -2.5799316642020887e-04          -0.00025799  V(7,8)
  239. X   3.6558708385757817e-04           0.00036559  V(8,8)
  240. X   7.1212458944209244e-09           0.00000001  D(1)
  241. X  -9.5291010557382897e-09          -0.00000001  D(2)
  242. X  -1.5778368693623276e-09          -0.00000000  D(3)
  243. X  -6.4433263552306315e-10          -0.00000000  D(4)
  244. X   1.5722264246975941e-09           0.00000000  D(5)
  245. X  -2.4312439036197547e-09          -0.00000000  D(6)
  246. X  -1.5845329475213192e-10          -0.00000000  D(7)
  247. X  -8.7707819833213637e-10          -0.00000000  D(8)
  248. X   4.4685695288184939e+02         446.85695288  obj
  249. END_OF_FILE
  250. if test 5775 -ne `wc -c <'ch5eg1/end3l.bak'`; then
  251.     echo shar: \"'ch5eg1/end3l.bak'\" unpacked with wrong size!
  252. fi
  253. # end of 'ch5eg1/end3l.bak'
  254. fi
  255. if test -f 'ch5eg1/ending.bak' -a "${1}" != "-c" ; then 
  256.   echo shar: Will not clobber existing file \"'ch5eg1/ending.bak'\"
  257. else
  258. echo shar: Extracting \"'ch5eg1/ending.bak'\" \(5775 characters\)
  259. sed "s/^X//" >'ch5eg1/ending.bak' <<'END_OF_FILE'
  260. XGallant, "Nonlinear Statistical Models," Chapter 5, Figure 3, p. 324-326
  261. XSUR                What estimation method?  Code SUR, TSLS, or GMM.
  262. X224                Number of observations, t = 1, ..., n.
  263. X2                  Number of equations, i.e. dimension of e.
  264. X0                  Number of instruments, i.e. dimension of Z.
  265. X8                  Number of parameters, i.e. dimension of theta.
  266. X50                 Upper limit on Gauss-Newton iterations.
  267. X1                  Number var iterates, ivar=0 means none.
  268. Xhomoskedastic      Code homoskedastic or heteroskedastic.
  269. X0                  Number of moving average terms MA for var estimate.
  270. Xnone               Code none or Parzen, none when MA>0 is unwise.
  271. X1.000000e-13       Convergence tolerance, tol=1.0e-8 is reasonable.
  272. X1.000000e-10       Inversion tolerance, eps=1.0e-13 is reasonable
  273. Xminimal            How much output?  Code none, minimal, or full.
  274. X8                  Computed rank of V.
  275. Xuncorrected        Divisor of var, corrected or uncorrected.
  276. X                   Blank line.
  277. X                   Blank line.
  278. X                   Blank line.
  279. X  -2.9245814501616803e+00          -2.92458145  theta(1)
  280. X  -1.2867460434063589e+00          -1.28674604  theta(2)
  281. X   8.1856990357452608e-01           0.81856990  theta(3)
  282. X   3.6115785200404138e-01           0.36115785  theta(4)
  283. X  -1.5375885808695555e+00          -1.53758858  theta(5)
  284. X  -1.0489590970263374e+00          -1.04895910  theta(6)
  285. X   3.0086700241162653e-02           0.03008670  theta(7)
  286. X  -4.6742011797582117e-01          -0.46742012  theta(8)
  287. X   1.6492462994112111e-01           0.16492463  var(1,1)
  288. X   9.2005729031321579e-02           0.09200573  var(2,1)
  289. X   9.2005729031321579e-02           0.09200573  var(1,2)
  290. X   8.9642642316875812e-02           0.08964264  var(2,2)
  291. X   7.6048540298630313e-02           0.07604854  V(1,1)
  292. X  -3.9441553460601381e-02          -0.03944155  V(2,1)
  293. X  -8.1363244658375945e-03          -0.00813632  V(3,1)
  294. X   2.2551454088996347e-03           0.00225515  V(4,1)
  295. X   1.5161071040894071e-02           0.01516107  V(5,1)
  296. X  -8.6386978244942293e-04          -0.00086387  V(6,1)
  297. X  -2.9360670383682128e-03          -0.00293607  V(7,1)
  298. X  -2.1820501983515709e-03          -0.00218205  V(8,1)
  299. X  -3.9441553460601381e-02          -0.03944155  V(1,2)
  300. X   5.0609776285336930e-02           0.05060978  V(2,2)
  301. X   2.1939598380520749e-03           0.00219396  V(3,2)
  302. X   7.1346736728890531e-04           0.00071347  V(4,2)
  303. X  -2.4452170498858623e-03          -0.00244522  V(5,2)
  304. X   1.2263248643774908e-02           0.01226325  V(6,2)
  305. X   3.2176432662395357e-03           0.00321764  V(7,2)
  306. X   1.7266330377801262e-03           0.00172663  V(8,2)
  307. X  -8.1363244658375945e-03          -0.00813632  V(1,3)
  308. X   2.1939598380520749e-03           0.00219396  V(2,3)
  309. X   6.4415535695106418e-03           0.00644155  V(3,3)
  310. X   7.8138028913347761e-04           0.00078138  V(4,3)
  311. X  -6.0353186597764865e-03          -0.00603532  V(5,3)
  312. X  -2.3859940684536310e-03          -0.00238599  V(6,3)
  313. X  -7.5345196703219372e-04          -0.00075345  V(7,3)
  314. X   8.0829924747999706e-04           0.00080830  V(8,3)
  315. X   2.2551454088996347e-03           0.00225515  V(1,4)
  316. X   7.1346736728890531e-04           0.00071347  V(2,4)
  317. X   7.8138028913347761e-04           0.00078138  V(3,4)
  318. X   9.0343959846035443e-04           0.00090344  V(4,4)
  319. X  -4.8087021200371650e-04          -0.00048087  V(5,4)
  320. X   1.0129070210761102e-03           0.00101291  V(6,4)
  321. X  -7.9073548924408663e-04          -0.00079074  V(7,4)
  322. X   2.7549163836087631e-04           0.00027549  V(8,4)
  323. X   1.5161071040894071e-02           0.01516107  V(1,5)
  324. X  -2.4452170498858623e-03          -0.00244522  V(2,5)
  325. X  -6.0353186597764865e-03          -0.00603532  V(3,5)
  326. X  -4.8087021200371650e-04          -0.00048087  V(4,5)
  327. X   8.3213669176229327e-03           0.00832137  V(5,5)
  328. X   2.0084691585193232e-03           0.00200847  V(6,5)
  329. X   1.1068054871987483e-03           0.00110681  V(7,5)
  330. X  -1.1537431897854821e-03          -0.00115374  V(8,5)
  331. X  -8.6386978244942293e-04          -0.00086387  V(1,6)
  332. X   1.2263248643774908e-02           0.01226325  V(2,6)
  333. X  -2.3859940684536310e-03          -0.00238599  V(3,6)
  334. X   1.0129070210761102e-03           0.00101291  V(4,6)
  335. X   2.0084691585193232e-03           0.00200847  V(5,6)
  336. X   6.8944369024945473e-03           0.00689444  V(6,6)
  337. X   1.5596012364267730e-04           0.00015596  V(7,6)
  338. X   4.9917336963915457e-04           0.00049917  V(8,6)
  339. X  -2.9360670383682128e-03          -0.00293607  V(1,7)
  340. X   3.2176432662395357e-03           0.00321764  V(2,7)
  341. X  -7.5345196703219372e-04          -0.00075345  V(3,7)
  342. X  -7.9073548924408663e-04          -0.00079074  V(4,7)
  343. X   1.1068054871987483e-03           0.00110681  V(5,7)
  344. X   1.5596012364267730e-04           0.00015596  V(6,7)
  345. X   1.2861607343363046e-03           0.00128616  V(7,7)
  346. X  -2.4275726609718795e-04          -0.00024276  V(8,7)
  347. X  -2.1820501983515709e-03          -0.00218205  V(1,8)
  348. X   1.7266330377801262e-03           0.00172663  V(2,8)
  349. X   8.0829924747999706e-04           0.00080830  V(3,8)
  350. X   2.7549163836087631e-04           0.00027549  V(4,8)
  351. X  -1.1537431897854821e-03          -0.00115374  V(5,8)
  352. X   4.9917336963915457e-04           0.00049917  V(6,8)
  353. X  -2.4275726609718795e-04          -0.00024276  V(7,8)
  354. X   3.6531994032499421e-04           0.00036532  V(8,8)
  355. X   7.1212458944209244e-09           0.00000001  D(1)
  356. X  -9.5291010557382897e-09          -0.00000001  D(2)
  357. X  -1.5778368693623276e-09          -0.00000000  D(3)
  358. X  -6.4433263552306315e-10          -0.00000000  D(4)
  359. X   1.5722264246975941e-09           0.00000000  D(5)
  360. X  -2.4312439036197547e-09          -0.00000000  D(6)
  361. X  -1.5845329475213192e-10          -0.00000000  D(7)
  362. X  -8.7707819833213637e-10          -0.00000000  D(8)
  363. X   4.4685695288184939e+02         446.85695288  obj
  364. END_OF_FILE
  365. if test 5775 -ne `wc -c <'ch5eg1/ending.bak'`; then
  366.     echo shar: \"'ch5eg1/ending.bak'\" unpacked with wrong size!
  367. fi
  368. # end of 'ch5eg1/ending.bak'
  369. fi
  370. if test -f 'ch6eg1/ending.bak' -a "${1}" != "-c" ; then 
  371.   echo shar: Will not clobber existing file \"'ch6eg1/ending.bak'\"
  372. else
  373. echo shar: Extracting \"'ch6eg1/ending.bak'\" \(5772 characters\)
  374. sed "s/^X//" >'ch6eg1/ending.bak' <<'END_OF_FILE'
  375. XGallant, "Nonlinear Statistical Models," Chapter 6, Figure 1, p. 436.
  376. XTSLS               What estimation method?  Code SUR, TSLS, or GMM.
  377. X220                Number of observations, t = 1, ..., n.
  378. X2                  Number of equations, i.e. dimension of e.
  379. X17                 Number of instruments, i.e. dimension of Z.
  380. X8                  Number of parameters, i.e. dimension of theta.
  381. X20                 Upper limit on Gauss-Newton iterations.
  382. X1                  Number var iterates, ivar=0 means none.
  383. Xhomoskedastic      Code homoskedastic or heteroskedastic.
  384. X0                  Number of moving average terms MA for var estimate.
  385. Xnone               Code none or Parzen, none when MA>0 is unwise.
  386. X1.000000e-08       Convergence tolerance, tol=1.0e-8 is reasonable.
  387. X1.000000e-10       Inversion tolerance, eps=1.0e-13 is reasonable
  388. Xfull               How much output?  Code none, minimal, or full.
  389. X8                  Computed rank of V.
  390. Xuncorrected        Divisor of var, corrected or uncorrected.
  391. X                   Blank line.
  392. X                   Blank line.
  393. X                   Blank line.
  394. X  -2.1378778275860273e+00          -2.13787783  theta(1)
  395. X  -1.9893911556433312e+00          -1.98939116  theta(2)
  396. X   7.0939153916745556e-01           0.70939154  theta(3)
  397. X   3.3663399323270310e-01           0.33663399  theta(4)
  398. X  -1.4019968694481941e+00          -1.40199687  theta(5)
  399. X  -1.1388969627624823e+00          -1.13889696  theta(6)
  400. X   2.9131488559477250e-02           0.02913149  theta(7)
  401. X  -5.0050229673416280e-01          -0.50050230  theta(8)
  402. X   1.6847307354905444e-01           0.16847307  var(1,1)
  403. X   9.4991006557633997e-02           0.09499101  var(2,1)
  404. X   9.4991006557633997e-02           0.09499101  var(1,2)
  405. X   9.3711564655296287e-02           0.09371156  var(2,2)
  406. X   3.4123357521137065e-01           0.34123358  V(1,1)
  407. X  -4.0515026192173231e-01          -0.40515026  V(2,1)
  408. X  -7.4443670981270527e-02          -0.07444367  V(3,1)
  409. X  -1.7075137202523048e-02          -0.01707514  V(4,1)
  410. X   7.3616408974018430e-02           0.07361641  V(5,1)
  411. X  -8.0520944995638929e-02          -0.08052094  V(6,1)
  412. X  -1.3988025621517654e-02          -0.01398803  V(7,1)
  413. X  -2.2077927314748533e-02          -0.02207793  V(8,1)
  414. X  -4.0515026192173231e-01          -0.40515026  V(1,2)
  415. X   5.6591782097119825e-01           0.56591782  V(2,2)
  416. X   9.3113487046268872e-02           0.09311349  V(3,2)
  417. X   2.8410019934882371e-02           0.02841002  V(4,2)
  418. X  -8.0617530766411080e-02          -0.08061753  V(5,2)
  419. X   1.2644653136927941e-01           0.12644653  V(6,2)
  420. X   1.9325013502098160e-02           0.01932501  V(7,2)
  421. X   2.9896132263088925e-02           0.02989613  V(8,2)
  422. X  -7.4443670981270527e-02          -0.07444367  V(1,3)
  423. X   9.3113487046268872e-02           0.09311349  V(2,3)
  424. X   2.4067454001684946e-02           0.02406745  V(3,3)
  425. X   5.7835699332500186e-03           0.00578357  V(4,3)
  426. X  -2.1581815564116969e-02          -0.02158182  V(5,3)
  427. X   1.7403224408106693e-02           0.01740322  V(6,3)
  428. X   1.9150094956931823e-03           0.00191501  V(7,3)
  429. X   5.9076727860237991e-03           0.00590767  V(8,3)
  430. X  -1.7075137202523048e-02          -0.01707514  V(1,4)
  431. X   2.8410019934882371e-02           0.02841002  V(2,4)
  432. X   5.7835699332500186e-03           0.00578357  V(3,4)
  433. X   2.5487432759845568e-03           0.00254874  V(4,4)
  434. X  -4.7950486640943122e-03          -0.00479505  V(5,4)
  435. X   7.3439708547267122e-03           0.00734397  V(6,4)
  436. X  -5.1094810414861448e-05          -0.00005109  V(7,4)
  437. X   1.8674253117946520e-03           0.00186743  V(8,4)
  438. X   7.3616408974018430e-02           0.07361641  V(1,5)
  439. X  -8.0617530766411080e-02          -0.08061753  V(2,5)
  440. X  -2.1581815564116969e-02          -0.02158182  V(3,5)
  441. X  -4.7950486640943122e-03          -0.00479505  V(4,5)
  442. X   2.2762057613803403e-02           0.02276206  V(5,5)
  443. X  -1.5195066143983841e-02          -0.01519507  V(6,5)
  444. X  -9.9415605596577862e-04          -0.00099416  V(7,5)
  445. X  -5.6251801394123823e-03          -0.00562518  V(8,5)
  446. X  -8.0520944995638929e-02          -0.08052094  V(1,6)
  447. X   1.2644653136927941e-01           0.12644653  V(2,6)
  448. X   1.7403224408106693e-02           0.01740322  V(3,6)
  449. X   7.3439708547267122e-03           0.00734397  V(4,6)
  450. X  -1.5195066143983841e-02          -0.01519507  V(5,6)
  451. X   3.3346276344180567e-02           0.03334628  V(6,6)
  452. X   3.7331467729901690e-03           0.00373315  V(7,6)
  453. X   6.9269333322694495e-03           0.00692693  V(8,6)
  454. X  -1.3988025621517654e-02          -0.01398803  V(1,7)
  455. X   1.9325013502098160e-02           0.01932501  V(2,7)
  456. X   1.9150094956931823e-03           0.00191501  V(3,7)
  457. X  -5.1094810414861448e-05          -0.00005109  V(4,7)
  458. X  -9.9415605596577862e-04          -0.00099416  V(5,7)
  459. X   3.7331467729901690e-03           0.00373315  V(6,7)
  460. X   2.0417788436814010e-03           0.00204178  V(7,7)
  461. X   6.0905830809060847e-04           0.00060906  V(8,7)
  462. X  -2.2077927314748533e-02          -0.02207793  V(1,8)
  463. X   2.9896132263088925e-02           0.02989613  V(2,8)
  464. X   5.9076727860237991e-03           0.00590767  V(3,8)
  465. X   1.8674253117946520e-03           0.00186743  V(4,8)
  466. X  -5.6251801394123823e-03          -0.00562518  V(5,8)
  467. X   6.9269333322694495e-03           0.00692693  V(6,8)
  468. X   6.0905830809060847e-04           0.00060906  V(7,8)
  469. X   2.0036106220501352e-03           0.00200361  V(8,8)
  470. X   1.6787206308357473e-07           0.00000017  D(1)
  471. X  -2.4625529712808257e-07          -0.00000025  D(2)
  472. X  -4.6504414197150224e-08          -0.00000005  D(3)
  473. X  -1.4610224422905096e-08          -0.00000001  D(4)
  474. X   4.0400010629413197e-08           0.00000004  D(5)
  475. X  -5.8821932254927893e-08          -0.00000006  D(6)
  476. X  -8.2632941559150507e-09          -0.00000001  D(7)
  477. X  -1.6640001385280539e-08          -0.00000002  D(8)
  478. X   3.5611514196184793e+01          35.61151420  obj
  479. END_OF_FILE
  480. if test 5772 -ne `wc -c <'ch6eg1/ending.bak'`; then
  481.     echo shar: \"'ch6eg1/ending.bak'\" unpacked with wrong size!
  482. fi
  483. # end of 'ch6eg1/ending.bak'
  484. fi
  485. if test -f 'ch6eg2/detail3l.bak' -a "${1}" != "-c" ; then 
  486.   echo shar: Will not clobber existing file \"'ch6eg2/detail3l.bak'\"
  487. else
  488. echo shar: Extracting \"'ch6eg2/detail3l.bak'\" \(7043 characters\)
  489. sed "s/^X//" >'ch6eg2/detail3l.bak' <<'END_OF_FILE'
  490. X
  491. X
  492. X     **********************************************************************
  493. X     *                                                                    *
  494. X     *                             nlmdl 2.0                              *
  495. X     *                                                                    *
  496. X     **********************************************************************
  497. X
  498. X
  499. X     **********************************************************************
  500. X     *                                                                    *
  501. X     *                         Parameter settings                         *
  502. X     *                                                                    *
  503. X     **********************************************************************
  504. X
  505. X     Gallant, "Nonlinear Statistical Models," Chapter 6, Figure 2, p. 449-450.
  506. X     GMM                What estimation method?  Code SUR, TSLS, or GMM.
  507. X     238                Number of observations, t = 1, ..., n.
  508. X     1                  Number of equations, i.e. dimension of e.
  509. X     3                  Number of instruments, i.e. dimension of Z.
  510. X     2                  Number of parameters, i.e. dimension of theta.
  511. X     20                 Upper limit on Gauss-Newton iterations.
  512. X     1                  Number var iterates, ivar=0 means none.
  513. X     heteroskedastic    Code homoskedastic or heteroskedastic.
  514. X     3                  Number of moving average terms MA for var estimate.
  515. X     Parzen             Code none or Parzen, none when MA>0 is unwise.
  516. X     1.000000e-05       Convergence tolerance, tol=1.0e-8 is reasonable.
  517. X     1.000000e-13       Inversion tolerance, eps=1.0e-13 is reasonable
  518. X     full               How much output?  Code none, minimal, or full.
  519. X
  520. X
  521. X     **********************************************************************
  522. X     *                                                                    *
  523. X     *                           Starting theta                           *
  524. X     *                                                                    *
  525. X     **********************************************************************
  526. X                                           Col  1
  527. X                               Row  1   -0.400000
  528. X                               Row  2    0.900000
  529. X
  530. Xvar_loop 0
  531. X   2.3800000000000000e+02         238.00000000  var(1,1)
  532. X   2.3848513503508150e+02         238.48513504  var(2,1)
  533. X   2.3866807009536583e+02         238.66807010  var(3,1)
  534. X   2.3848513503508150e+02         238.48513504  var(1,2)
  535. X   2.3897620940526255e+02         238.97620941  var(2,2)
  536. X   2.3916481122626234e+02         239.16481123  var(3,2)
  537. X   2.3866807009536583e+02         238.66807010  var(1,3)
  538. X   2.3916481122626234e+02         239.16481123  var(2,3)
  539. X   2.3975964092305995e+02         239.75964092  var(3,3)
  540. X
  541. Xtheta_loop 0
  542. X  -4.0000000000000002e-01          -0.40000000  theta(1)
  543. X   9.0000000000000002e-01           0.90000000  theta(2)
  544. X   2.2977593855825589e+00           2.29775939  obj
  545. X  -4.9910043429446205e-01          -0.49910043  D(1)
  546. X   9.8933364963875864e-02           0.09893336  D(2)
  547. XStep length = 1 
  548. X
  549. Xtheta_loop 1
  550. X  -8.9910043429446207e-01          -0.89910043  theta(1)
  551. X   9.9893336496387586e-01           0.99893336  theta(2)
  552. X   2.7751760221041621e-03           0.00277518  obj
  553. X   5.0366043831498272e-02           0.05036604  D(1)
  554. X  -4.4414610501568677e-06          -0.00000444  D(2)
  555. XStep length = 1 
  556. X
  557. Xtheta_loop 2
  558. X  -8.4873439046296384e-01          -0.84873439  theta(1)
  559. X   9.9892892350282569e-01           0.99892892  theta(2)
  560. X   2.7717868638761308e-03           0.00277179  obj
  561. X  -1.1734797022229638e-04          -0.00011735  D(1)
  562. X   2.1096605255709332e-07           0.00000021  D(2)
  563. XStep length = 1 
  564. X
  565. Xtheta_loop 3
  566. X  -8.4885173843318618e-01          -0.84885174  theta(1)
  567. X   9.9892913446887821e-01           0.99892913  theta(2)
  568. X   2.7717868580610532e-03           0.00277179  obj
  569. X   2.6798358348564710e-07           0.00000027  D(1)
  570. X  -5.5350439549602871e-10          -0.00000000  D(2)
  571. XTolerence check passed.
  572. X
  573. Xvar_loop 1
  574. X   4.3978220854904504e-01           0.43978221  var(1,1)
  575. X   4.4050039895600307e-01           0.44050040  var(2,1)
  576. X   4.3420956263910121e-01           0.43420956  var(3,1)
  577. X   4.4050039895600307e-01           0.44050040  var(1,2)
  578. X   4.4122700259798669e-01           0.44122700  var(2,2)
  579. X   4.3493663977747488e-01           0.43493664  var(3,2)
  580. X   4.3420956263910121e-01           0.43420956  var(1,3)
  581. X   4.3493663977747488e-01           0.43493664  var(2,3)
  582. X   4.2967081964723475e-01           0.42967082  var(3,3)
  583. X
  584. Xtheta_loop 0
  585. X  -8.4885173843318618e-01          -0.84885174  theta(1)
  586. X   9.9892913446887821e-01           0.99892913  theta(2)
  587. X   1.2014636301992196e+00           1.20146363  obj
  588. X  -6.4020486065461402e-03          -0.00640205  D(1)
  589. X  -8.8353145570584189e-04          -0.00088353  D(2)
  590. XStep length = 1 
  591. X
  592. Xtheta_loop 1
  593. X  -8.5525378703973232e-01          -0.85525379  theta(1)
  594. X   9.9804560301317236e-01           0.99804560  theta(2)
  595. X   1.0861341198092420e+00           1.08613412  obj
  596. X   2.6747016119385693e-06           0.00000267  D(1)
  597. X  -1.7073275785211286e-08          -0.00000002  D(2)
  598. XTolerence check passed.
  599. X
  600. X
  601. X     **********************************************************************
  602. X     *                                                                    *
  603. X     *                               theta                                *
  604. X     *                                                                    *
  605. X     **********************************************************************
  606. X                                           Col  1
  607. X                               Row  1   -0.855254
  608. X                               Row  2    0.998046
  609. X
  610. X
  611. X
  612. X     **********************************************************************
  613. X     *                                                                    *
  614. X     *                                var                                 *
  615. X     *                (no degrees of freedom corrections)                 *
  616. X     *                                                                    *
  617. X     **********************************************************************
  618. X                               Col  1      Col  2      Col  3
  619. X                   Row  1    0.439782    0.440500    0.434210
  620. X                   Row  2    0.440500    0.441227    0.434937
  621. X                   Row  3    0.434210    0.434937    0.429671
  622. X
  623. X
  624. X
  625. X     **********************************************************************
  626. X     *                                                                    *
  627. X     *                                 V                                  *
  628. X     *                             (rank = 2)                             *
  629. X     *                                                                    *
  630. X     **********************************************************************
  631. X                                     Col  1      Col  2
  632. X                         Row  1     3.60663 -0.00715768
  633. X                         Row  2 -0.00715768   2.117e-05
  634. X
  635. END_OF_FILE
  636. if test 7043 -ne `wc -c <'ch6eg2/detail3l.bak'`; then
  637.     echo shar: \"'ch6eg2/detail3l.bak'\" unpacked with wrong size!
  638. fi
  639. # end of 'ch6eg2/detail3l.bak'
  640. fi
  641. if test -f 'display.cc' -a "${1}" != "-c" ; then 
  642.   echo shar: Will not clobber existing file \"'display.cc'\"
  643. else
  644. echo shar: Extracting \"'display.cc'\" \(4567 characters\)
  645. sed "s/^X//" >'display.cc' <<'END_OF_FILE'
  646. X/* ----------------------------------------------------------------------------
  647. X
  648. Xnlmdl: display.cc
  649. X
  650. Xnlmdl is a C++ implementation of the statistical methods in A. Ronald 
  651. XGallant, "Nonlinear Statistical Models," New York: John Wiley and Sons, 
  652. X1987, ISBN 0-471-80260-3, using a matrix class realmat that is distributed 
  653. Xwith it.  The header files nlmdl.h and realmat.h describe the use of the 
  654. Xprogram and matrix class, respectively.  
  655. X
  656. XCopyright (C) 1990.
  657. X
  658. XA. Ronald Gallant
  659. XP.O. Box 5513 
  660. XRaleigh NC 27650-5513 
  661. XUSA   
  662. X
  663. XPermission to use, copy, modify, and distribute this software and its 
  664. Xdocumentation for any purpose and without fee is hereby granted, provided 
  665. Xthat the above copyright notice appear in all copies and that both that 
  666. Xcopyright notice and this permission notice appear in supporting 
  667. Xdocumentation.  
  668. X
  669. XThis software is provided "as is" without any expressed or implied warranty.
  670. X
  671. X---------------------------------------------------------------------------- */
  672. X/* display.cc is a piece of status.cc that was split */
  673. X/* out to reduce Turbo C++ memory requirements.      */
  674. X
  675. X#include "status.h"
  676. X
  677. Xint status::display(display_mode mode)
  678. X{
  679. X
  680. X  INTEGER i,j,len;
  681. X  char    temp[MAX_STATUS_LINE];
  682. X  char*   pad = "     ";
  683. X
  684. X
  685. X  switch (mode) {
  686. X
  687. X  case START_UP:
  688. X
  689. X    cout << starbox("/Parameter settings//_") << "\n";
  690. X
  691. X    cout<<pad<< switches << "\n";
  692. X
  693. X    sprintf(temp,"%-19s", method);
  694. X    cout<<pad<<temp<< "What estimation method?  Code SUR, TSLS, or GMM.\n";
  695. X
  696. X    sprintf(temp,"%-19d", n);
  697. X    cout<<pad<<temp<< "Number of observations, t = 1, ..., n.\n";
  698. X
  699. X    sprintf(temp,"%-19d",M);
  700. X    cout<<pad<<temp<< "Number of equations, i.e. dimension of e.\n";
  701. X
  702. X    sprintf(temp,"%-19d",K);
  703. X    cout<<pad<<temp<<"Number of instruments, i.e. dimension of Z.\n";
  704. X
  705. X    sprintf(temp,"%-19d",p);
  706. X    cout<<pad<<temp<<"Number of parameters, i.e. dimension of theta.\n";
  707. X
  708. X    sprintf(temp,"%-19d",itheta);
  709. X    cout<<pad<<temp<< "Upper limit on Gauss-Newton iterations.\n";
  710. X
  711. X    sprintf(temp,"%-19d",ivar);
  712. X    cout<<pad<<temp<< "Number var iterates, ivar=0 means none.\n";
  713. X
  714. X    sprintf(temp,"%-19s",vartype);
  715. X    cout<<pad<<temp<< "Code homoskedastic or heteroskedastic.\n";
  716. X
  717. X    sprintf(temp,"%-19d",MA);
  718. X    cout<<pad<<temp<< "Number of moving average terms MA for var estimate.\n";
  719. X
  720. X    sprintf(temp,"%-19s",weights);
  721. X    cout<<pad<<temp<< "Code none or Parzen, none when MA>0 is unwise.\n";
  722. X
  723. X    sprintf(temp,"%-19.6e",tol);
  724. X    cout<<pad<<temp<< "Convergence tolerance, tol=1.0e-8 is reasonable.\n";
  725. X
  726. X    sprintf(temp,"%-19.6e",eps);
  727. X    cout<<pad<<temp<< "Inversion tolerance, eps=1.0e-13 is reasonable\n";
  728. X
  729. X    sprintf(temp,"%-19s",detail);
  730. X    cout<<pad<<temp<< "How much output?  Code none, minimal, or full.\n";
  731. X
  732. X    break;
  733. X
  734. X  case VAR_ITERATE:
  735. X
  736. X    if ( rows(var) > 0 && cols(var) > 0 ){
  737. X      if ( strcmp(method,"SUR") == 0 || strcmp(method,"TSLS") == 0){
  738. X        for (j=1; j<=M; j++){ 
  739. X        for (i=1; i<=M; i++){ 
  740. X          sprintf(temp,"%25.16e % 20.8f ",var.check2(i,j),var.elem(i,j));
  741. X          cout<<temp<< " var(" << i << "," << j << ")\n";
  742. X        }
  743. X        }  
  744. X      }
  745. X      else{
  746. X        len = M*K;
  747. X        for (j=1; j<=len; j++){
  748. X        for (i=1; i<=len; i++){
  749. X          sprintf(temp,"%25.16e % 20.8f ",var.check2(i,j),var.elem(i,j));
  750. X          cout<<temp<< " var(" << i << "," << j << ")\n";
  751. X        }
  752. X        }
  753. X      }
  754. X    }
  755. X    else{
  756. X      cout << "Error, status::display, var is not initialized.\n";
  757. X    }
  758. X
  759. X    break;
  760. X
  761. X   case THETA_ITERATE:
  762. X
  763. X    if ( rows(theta) > 0 && cols(theta) > 0 ){
  764. X      for (i=1; i<=p; i++){
  765. X        sprintf(temp,"%25.16e % 20.8f ",theta[i],theta[i]);
  766. X        cout<<temp<< " theta(" << i << ")\n";
  767. X      }
  768. X    }
  769. X    else{
  770. X      cout << "Error, status::display, theta is not initialized.\n";
  771. X    }
  772. X
  773. X    sprintf(temp,"%25.16e % 20.8f ",obj,obj);
  774. X    cout<<temp<< " obj\n";
  775. X
  776. X    if (strcmp(detail,"full")!=0) break;
  777. X
  778. X    if ( rows(D) > 0 && cols(D) > 0 ){
  779. X      for (i=1; i<=p; i++){
  780. X        sprintf(temp,"%25.16e % 20.8f ",D[i],D[i]);
  781. X        cout<<temp<< " D(" << i << ")\n";
  782. X      }
  783. X    }
  784. X    else{
  785. X      cout << "Error, status::display, D is not initialized.\n";
  786. X    }
  787. X    break;
  788. X
  789. X  case TERMINATION:
  790. X  
  791. X    cout << starbox("/theta//_") << theta << "\n";
  792. X
  793. X    if (strcmp(df,"corrected") == 0)
  794. X      cout << starbox("/var/(corrected for degrees of freedom)//_");
  795. X    else
  796. X      cout << starbox("/var/(no degrees of freedom corrections)//_"); 
  797. X
  798. X    cout << var << "\n";
  799. X
  800. X    sprintf(temp,"/V/(rank = %d)//_",rank);
  801. X    cout << starbox(temp) << V << "\n";
  802. X
  803. X    break;
  804. X
  805. X  }
  806. X
  807. X  cout.flush();
  808. X
  809. X  return 0;
  810. X
  811. X}
  812. END_OF_FILE
  813. if test 4567 -ne `wc -c <'display.cc'`; then
  814.     echo shar: \"'display.cc'\" unpacked with wrong size!
  815. fi
  816. # end of 'display.cc'
  817. fi
  818. if test -f 'nlmdl.h' -a "${1}" != "-c" ; then 
  819.   echo shar: Will not clobber existing file \"'nlmdl.h'\"
  820. else
  821. echo shar: Extracting \"'nlmdl.h'\" \(5856 characters\)
  822. sed "s/^X//" >'nlmdl.h' <<'END_OF_FILE'
  823. X/* ---------------------------------------------------------------------------
  824. X
  825. Xnlmdl: nlmdl.h
  826. X
  827. Xnlmdl is a C++ implementation of the statistical methods in A. Ronald 
  828. XGallant, "Nonlinear Statistical Models," New York: John Wiley and Sons, 
  829. X1987, ISBN 0-471-80260-3, using a matrix class realmat that is distributed 
  830. Xwith it.  The header files nlmdl.h and realmat.h describe the use of the 
  831. Xprogram and matrix class, respectively.  
  832. X
  833. XCopyright (C) 1990.
  834. X
  835. XA. Ronald Gallant
  836. XP.O. Box 5513 
  837. XRaleigh NC 27650-5513 
  838. XUSA   
  839. X
  840. XPermission to use, copy, modify, and distribute this software and its 
  841. Xdocumentation for any purpose and without fee is hereby granted, provided 
  842. Xthat the above copyright notice appear in all copies and that both that 
  843. Xcopyright notice and this permission notice appear in supporting 
  844. Xdocumentation.  
  845. X
  846. XThis software is provided "as is" without any expressed or implied warranty.
  847. X
  848. X----------------------------------------------------------------------------- 
  849. X
  850. XThis header describes the program nlmdl.cc for estimating theta of the model 
  851. Xe=q(t,theta).  The user supples a file named starting.dat whose contents are 
  852. Xdescribed by the template:
  853. X
  854. X  switches This line is passed to class model as a string.
  855. X  method   What estimation method?  Code SUR, TSLS, or GMM.
  856. X  n        Number of observations, t = 1, ..., n.
  857. X  M        Number of equations in the system, i.e. dimension of e.
  858. X  K        Number of instruments, i.e. dimension of Z, code K=0 with SUR.
  859. X  p        Number of parameters, i.e. dimension of theta.
  860. X  itheta   Upper limit on Gauss-Newton iterations.
  861. X  ivar     Number of var iterates, ivar=0 means none.
  862. X  vartype  Code homoskedastic or heteroskedastic.
  863. X  MA       Number of moving average terms for var estimate, code MA=0 if e iid.
  864. X  weights  Code none or Parzen, coding none when MA>0 is asking for trouble.
  865. X  tol      Convergence tolerance, tol=1.0e-8 is reasonable.
  866. X  eps      Inversion tolerance, eps=1.0e-13 is reasonable (if REAL is double).
  867. X  detail   How much output?  Code none, minimal, or full.
  868. X           Blank line.
  869. X           Blank line.
  870. X           Blank line.
  871. X           Blank line.
  872. X           Blank line.
  873. X  theta(1) Starting values for theta.  These must be supplied.
  874. X           
  875. X    to
  876. X
  877. X  theta(p) 
  878. X  var(1)   Starting values for variance estimate.  These can be omitted.  
  879. X           Matrix is stored columnwise.  If method = SUR or TSLS then then 
  880. X    to     l=M and var corresponds to C(e,e').  If method = GMM then l=M*K 
  881. X           and var corresponds to the variance of sum on t of e Kronecker 
  882. X  var(l*l) product Z.  
  883. X
  884. X
  885. XSee class status for more detail, especially status::from.  The file 
  886. Xstarting.dat is read twice.  At the first reading it must contain at least 
  887. Xthe first line, switches.  Class model, described next, can supply entries 
  888. Xfor the second reading.  
  889. X
  890. XThe user also supplies the class model as files model.h and model.cc.  The 
  891. Xclass model is declared in model.h which should match the following template:
  892. X
  893. X   #include "status.h"
  894. X   external status s;
  895. X
  896. X   class model
  897. X   {   
  898. X   protected:
  899. X     //...
  900. X
  901. X   public:
  902. X            model();          
  903. X            ~model();           
  904. X   realmat  e_t;               // e_t    is s.M by 1
  905. X   realmat  dele_t;            // dele_t is s.M by s.p
  906. X   realmat  Z_t;               // Z_t    is s.K by 1, null if s.K = 0;
  907. X   int      initialize();
  908. X   int      terminate();
  909. X   void     e(INTEGER t);      // e    fills in e_t
  910. X   void     dele(INTEGER t);   // dele fills in dele_t = del e_t wrt theta
  911. X   void     Z(INTEGER t);      // Z    fills in Z_t
  912. X   }
  913. X
  914. XFor SUR, code the function Z as follows:
  915. X
  916. X   realmat model::Z(INTEGER t) { }
  917. X
  918. XIn writing the class model, the relevant facts regarding program flow in 
  919. Xnlmdl.cc are as follows: 
  920. X
  921. X  1. First, s is tentatively filled in by reading starting.dat using 
  922. X
  923. X       status s;
  924. X       s.from(s.starting);
  925. X
  926. X     The primary purpose of this read is to get the first line from 
  927. X     starting.dat so as to make it available to model as the string 
  928. X     s.switches.  Nonetheless, everything in starting.dat is read and 
  929. X     put in s.  
  930. X
  931. X  2. Next, initialize() of class model is called.  The function initialize() 
  932. X     can read starting.dat, can read other data, etc.  Since all of class 
  933. X     status's data is public, any of it can be filled in or changed by 
  934. X     initialize().  One could, for example, fill in all of class status's 
  935. X     data and write it using 
  936. X
  937. X       s.to(s.starting);
  938. X
  939. X     One could also switch to a different starting status file using 
  940. X
  941. X       s.starting="filename";
  942. X
  943. X     or a different ending status file using 
  944. X
  945. X       s.ending="filename";
  946. X
  947. X     If initialize() returns 0, execution stops.
  948. X
  949. X  3. Then, class status's data is definitively filled in by the call
  950. X
  951. X       s.from(s.starting);
  952. X
  953. X     and m.e_t, m.dele_t, and m.Z_t are dimensioned as
  954. X
  955. X       m.e_t.resize(s.M,1);
  956. X       m.dele_t.resize(s.M,s.p);
  957. X       if (s.K > 0) m.Z_t.resize(s.K,1);
  958. X                          
  959. X     and estimation proceeds using these settings and dimensions.  
  960. X
  961. X  4. Finally, terminate() of class model is called; terminate() can read data, 
  962. X     write data, etc.  If terminate() returns 0 execution stops, otherwise 
  963. X     initialize() is called again and the cycle repeats (from Step 2).  One 
  964. X     can use this feature to loop over a grid of starting values.
  965. X
  966. X
  967. XReference:
  968. X
  969. XGallant, A. Ronald (1987), "Nonlinear Statistical Models,"  New York: John 
  970. XWiley and Sons. ISBN 0-471-80260-3.
  971. X
  972. X--------------------------------------------------------------------------- */
  973. X
  974. X
  975. X#ifndef __FILE_NLMDL_H_SEEN__
  976. X#pragma once
  977. X#define __FILE_NLMDL_H_SEEN__ 1
  978. X
  979. X#include "usual.h"      //This header is also in status.h
  980. X#include "realmat.h"    //This header is also in status.h
  981. X#include "tools.h"      //This header is also in status.h
  982. X
  983. X#include "status.h"
  984. X#include "model.h"
  985. X
  986. X#define  VERSION "2.0"
  987. X
  988. X#endif
  989. X
  990. END_OF_FILE
  991. if test 5856 -ne `wc -c <'nlmdl.h'`; then
  992.     echo shar: \"'nlmdl.h'\" unpacked with wrong size!
  993. fi
  994. # end of 'nlmdl.h'
  995. fi
  996. if test -f 'realmat.h' -a "${1}" != "-c" ; then 
  997.   echo shar: Will not clobber existing file \"'realmat.h'\"
  998. else
  999. echo shar: Extracting \"'realmat.h'\" \(5870 characters\)
  1000. sed "s/^X//" >'realmat.h' <<'END_OF_FILE'
  1001. X/* ----------------------------------------------------------------------------
  1002. X
  1003. Xrealmat: realmat.h
  1004. X
  1005. Xrealmat is a C++ matrix class.  The header file realmat.h describes its use.
  1006. X
  1007. XCopyright (C) 1990.
  1008. X
  1009. XA. Ronald Gallant
  1010. XP.O. Box 5513 
  1011. XRaleigh NC 27650-5513 
  1012. XUSA   
  1013. X
  1014. XPermission to use, copy, modify, and distribute this software and its 
  1015. Xdocumentation for any purpose and without fee is hereby granted, provided 
  1016. Xthat the above copyright notice appear in all copies and that both that 
  1017. Xcopyright notice and this permission notice appear in supporting 
  1018. Xdocumentation.  
  1019. X
  1020. XThis software is provided "as is" without any expressed or implied warranty.
  1021. X
  1022. X------------------------------------------------------------------------------- 
  1023. X
  1024. XThis header defines a matrix class.  A matrix X with r rows, and c columns is 
  1025. Xconstructed using realmat X(r,c).  X is stored columnwise with no wasted space 
  1026. Xwhich is to say that vec(X) is what is stored.  Indexing of the elements starts 
  1027. Xwith 1, not zero.  The protected members of realmat are rows, cols, len, and x.
  1028. X
  1029. XAs an illustration, suppose X is constructed using realmat X(r,c).  Then 
  1030. XX.rows=r, X.cols=c, X.len=r*c, the pointer X.x points to the first element of 
  1031. Xvec(X), X[i] returns the i-th element of vec(X), i=1,...,X.len, X.elem(i,j) 
  1032. Xreturns the (i,j)-th element of X, i=1,...,X.rows, j=1,...,.X.cols.  An element 
  1033. Xof X is of type REAL and X.rows, X.cols, and X.len are of type INTEGER.  The 
  1034. Xtypedef of REAL and INTEGER is in usual.h.  To allocate store at run time, use
  1035. Xrealmat X; X.resize(r,c);.
  1036. X
  1037. XThe operators +, -, *, =, +=, -=, ++, --, ==, !=, <, <=, >, >= and << are 
  1038. Xdefined.  T(X) transposes X.  X.check1(i) and X.check2(i,j) access the elements 
  1039. Xof vec(X) and X respectively with range checking.  invpsd(X) or invpsd(X,eps) 
  1040. Xreturns a g-inverse of a positive semi-definite, symmetric matrix X with 
  1041. Xminimal error checking; eps is the tolerance used in rank determination and 
  1042. Xdefaults to 1.e-13.  rows(X) returns X.rows and cols(X) returns X.cols.  The 
  1043. Xoperator ++ acts like ++X, not like X++; similarly for --.  The operators ==,
  1044. X<, <=, >, and >= evaluate to true if the matrices compared are the same size 
  1045. Xand the relation is true for each element; (A!=B) = !(A==B).
  1046. X
  1047. X-----------------------------------------------------------------------------*/
  1048. X
  1049. X#ifndef __FILE_REALMAT_H_SEEN__
  1050. X#pragma once
  1051. X#define __FILE_REALMAT_H_SEEN__ 1
  1052. X
  1053. X#include "usual.h"
  1054. X#include "tools.h"
  1055. X
  1056. Xclass realmat
  1057. X{
  1058. Xprotected:
  1059. X
  1060. X  INTEGER       rows;
  1061. X  INTEGER       cols;
  1062. X  INTEGER       len;
  1063. X  REAL          *x;
  1064. X
  1065. X                realmat(INTEGER r, INTEGER c, REAL* a);
  1066. X  void          resize(INTEGER r, INTEGER c, REAL* a); //expects this.x == 0
  1067. X
  1068. X
  1069. Xpublic:
  1070. X                realmat();
  1071. X
  1072. X                realmat(INTEGER r, INTEGER c);
  1073. X                realmat(INTEGER r, INTEGER c, REAL fill_value);
  1074. X
  1075. X                realmat(realmat&);
  1076. X
  1077. X                ~realmat();
  1078. X
  1079. Xvoid            resize(INTEGER r, INTEGER c);
  1080. Xvoid            resize(INTEGER r, INTEGER c, REAL fill_value);
  1081. X
  1082. Xrealmat&        operator=(realmat& a);
  1083. Xrealmat&        operator+=(realmat& a);
  1084. Xrealmat&        operator-=(realmat& a);
  1085. Xrealmat&        operator++();
  1086. Xrealmat&        operator--();
  1087. X
  1088. XREAL&           operator[](INTEGER i);
  1089. XREAL&           elem(INTEGER i, INTEGER j);
  1090. XREAL&           check1(INTEGER i);
  1091. XREAL&           check2(INTEGER i, INTEGER j);
  1092. X
  1093. Xvoid            error(const char* msg);
  1094. X
  1095. Xfriend int      operator==(realmat& a, realmat& b);
  1096. Xfriend int      operator!=(realmat& a, realmat& b);
  1097. X
  1098. Xfriend int      operator<(realmat& a, realmat& b);
  1099. Xfriend int      operator>(realmat& a, realmat& b);
  1100. X
  1101. Xfriend int      operator<=(realmat& a, realmat& b);
  1102. Xfriend int      operator>=(realmat& a, realmat& b);
  1103. X
  1104. Xfriend INTEGER  rows(realmat& a);
  1105. Xfriend INTEGER  cols(realmat& a);
  1106. X
  1107. Xfriend ostream& operator<<(ostream& stream, realmat& a);
  1108. X
  1109. Xfriend realmat  operator+(realmat& a, realmat& b);
  1110. Xfriend realmat  operator+(realmat& a);
  1111. X
  1112. Xfriend realmat  operator-(realmat& a, realmat& b);
  1113. Xfriend realmat  operator-(realmat& a);
  1114. X
  1115. Xfriend realmat  operator*(realmat& a, realmat& b);
  1116. Xfriend realmat  operator*(REAL&    a, realmat& b);
  1117. Xfriend realmat  operator*(INTEGER& a, realmat& b);
  1118. X
  1119. Xfriend realmat  T(realmat& a);
  1120. X
  1121. Xfriend realmat  invpsd(realmat& a, REAL eps = 1.0e-13); //a is psd, symmetric
  1122. X
  1123. X};
  1124. X
  1125. X
  1126. X//protected:
  1127. X
  1128. Xinline realmat::realmat(INTEGER r, INTEGER c, REAL* a)
  1129. X  {rows=r; cols=c; len=r*c; x = a;}
  1130. X
  1131. Xinline void realmat::resize(INTEGER r, INTEGER c, REAL* a)
  1132. X  {rows=r; cols=c; len=r*c; x = a;} //Note: No delete, this.x == 0 expected.
  1133. X
  1134. X
  1135. X//public:
  1136. X
  1137. Xinline int operator!=(realmat& a, realmat& b)
  1138. X  {return !(a == b);}
  1139. X
  1140. Xinline REAL& realmat::operator[](INTEGER i)
  1141. X  {return x[i-1];}
  1142. X
  1143. Xinline REAL& realmat::elem(INTEGER i, INTEGER j)
  1144. X  {return x[i + rows*j - rows - 1];}   // returns x[rows*(j-1)+i-1]
  1145. X
  1146. Xinline INTEGER rows(realmat& a)
  1147. X  {return a.rows;}
  1148. X
  1149. Xinline INTEGER cols(realmat& a)
  1150. X  {return a.cols;}
  1151. X
  1152. Xinline realmat::~realmat()
  1153. X  {delete x;} 
  1154. X
  1155. Xinline realmat::realmat()
  1156. X  {rows=0; cols=0; len=0; x = 0;}
  1157. X
  1158. Xinline realmat::realmat(INTEGER r, INTEGER c) 
  1159. X{
  1160. X  if (r<=0) error("Error, realmat, realmat, Number of rows not positive");
  1161. X  if (c<=0) error("Error, realmat, realmat, Number of columns not positive");
  1162. X  rows=r; 
  1163. X  cols=c; 
  1164. X  len=r*c; 
  1165. X  x = new REAL[len];
  1166. X  if (x == 0) error("Error, realmat, realmat, Operator new failed");
  1167. X}
  1168. X
  1169. Xinline void realmat::resize(INTEGER r, INTEGER c)
  1170. X{
  1171. X  if (r<=0) error("Error, realmat, resize, Number of rows not positive");
  1172. X  if (c<=0) error("Error, realmat, resize, Number of columns not positive");
  1173. X  delete x;
  1174. X  rows=r; 
  1175. X  cols=c; 
  1176. X  len=r*c; 
  1177. X  x = new REAL[len];
  1178. X  if (x == 0) error("Error, realmat, resize, Operator new failed");
  1179. X}
  1180. X
  1181. Xextern void default_realmat_error_handler(const char* msg);
  1182. Xextern ONE_ARG_ERROR_HANDLER_T realmat_error_handler;
  1183. Xextern ONE_ARG_ERROR_HANDLER_T 
  1184. X  set_realmat_error_handler(ONE_ARG_ERROR_HANDLER_T f);
  1185. X
  1186. X#endif
  1187. END_OF_FILE
  1188. if test 5870 -ne `wc -c <'realmat.h'`; then
  1189.     echo shar: \"'realmat.h'\" unpacked with wrong size!
  1190. fi
  1191. # end of 'realmat.h'
  1192. fi
  1193. echo shar: End of archive 2 \(of 6\).
  1194. cp /dev/null ark2isdone
  1195. MISSING=""
  1196. for I in 1 2 3 4 5 6 ; do
  1197.     if test ! -f ark${I}isdone ; then
  1198.     MISSING="${MISSING} ${I}"
  1199.     fi
  1200. done
  1201. if test "${MISSING}" = "" ; then
  1202.     echo You have unpacked all 6 archives.
  1203.     rm -f ark[1-9]isdone
  1204. else
  1205.     echo You still need to unpack the following archives:
  1206.     echo "        " ${MISSING}
  1207. fi
  1208. ##  End of shell archive.
  1209. exit 0
  1210.  
  1211. exit 0 # Just in case...
  1212. -- 
  1213. Kent Landfield                   INTERNET: kent@sparky.IMD.Sterling.COM
  1214. Sterling Software, IMD           UUCP:     uunet!sparky!kent
  1215. Phone:    (402) 291-8300         FAX:      (402) 291-4362
  1216. Please send comp.sources.misc-related mail to kent@uunet.uu.net.
  1217.