/* This is the program file for Kevin L. Kliesen and Frank A. Schmid's article "MACROECONOMIC NEWS AND REAL INTEREST RATES" in the Federal Reserve Bank of St. Louis's Review, March/April 2006 issue. This file contains 3 Gauss programs: amemiya.prg, neweywest.prg and kernel01.prg The programs use proprietary MMS data (not provided) and Fed Fund Surprise measures (available at: http://research.stlouisfed.org/publications/review/04/05/0405kkd.txt) */ //program part1 (amemiya.prg) This program is used to produce Table 3 "On the Run 10 year TIIS Yield and Data Surprises" rao=1; @ 1: Rao test on heteroscedasticity @ save path=c:\data\strips\gauss; output file=c:\prg\strips\amemiya.out reset; str=datestr(0); tr=timestr(0); "GAUSS time ";; tr;; " date (US) ";; str; ?;"input file: amemiya.prg"; vnames="xx"; dtset1="c:\\data\\strips\\gauss\\dat2000"; @ data input for year 2000 @ dtset2="c:\\data\\strips\\gauss\\zinvzz"; dtset3="c:\\data\\strips\\gauss\\zinvzzzt"; dtset4="c:\\data\\strips\\gauss\\zinvzzz"; rob=2; @ 1: delete days on which a speech was given (not used in paper); 2: use core measures only @ ig=0; do while ig.<1; ig=ig+1; ln_=0; @ 1: take log first differences @ white=1; vnames="xx"; dtset0="c:\\data\\strips\\gauss\\nabe"; @ Kuttner measure @ /* dtset0="c:\\data\\strips\\gauss\\nabe2"; @ Poole/Rasche measure @ */ declare bvar2; open f0=^dtset0; dat_=readr(f0,rowsf(f0)); f0=close(f0); clear f0; @ compute the first differences @ @ obs are currently stacked like this: 1997|1998|...|2003 @ dat__=dat_[2:rows(dat_),.]; if ln_.==1; dat__[.,4 5]=ln(dat__[.,4 5]./dat_[1:rows(dat_)-1,4 5]); else; dat__[.,4 5]=dat__[.,4 5]-dat_[1:rows(dat_)-1,4 5]; endif; @ dat__[.,4 5]; wait; @ dat=dat__; clear dat_,dat__; @ ----- define variables ----- @ y__4=dat[.,4]; @ change in 10-year TIIS yield @ y__5=dat[.,5]; @ change in 10-year TIIS yield @ if ig.==1; "OTR 10YR TIIS"; y__=y__4; y_t=y__5; @ for match.==1 @ dtset1="c:\\data\\strips\\gauss\\nwres1"; elseif ig.==2; "OTR 30YR TIIS"; y__=y__5; y_t=y__4; @ for match.==1 @ dtset1="c:\\data\\strips\\gauss\\nwres2"; elseif ig.==3; "OTR 30YR TIIS minus OTR 10YR TIIS"; y__=y__5-y__4; y_t=y__4; @ for match.==1 @ dtset1="c:\\data\\strips\\gauss\\nwres3"; endif; @ compile dataset @ @ dat=dat[.,1:43 45 46]; @ @ use all variables bar the trading day indicator @ x__=dat[.,7:cols(dat)]~ones(rows(dat),1); @ standardized macro announcement variables~const @ let seqa_=1 2 3 6 5 8 8.1 7 9 10 11 12 31 32 33 14 15 16 17 24 18 19 20 22 23 25 28 29 30 30.1 26 27 34 34.1 35 36 4 21 13 41 42; @ intercept indicator; intercept @ @ cols(x__); rows(seqa_); wait; @ @ do not use the core numbers @ x__=dat[.,7:12 14:35 37:39 41:cols(dat)]~ones(rows(dat),1); @ 12/13: CPI/Core; 35/36: PPI/Core; 39/40: Sales/ex.Auto @ let seqa_=1 2 3 6 5 8 7 9 10 11 12 31 32 33 14 15 16 17 24 18 19 20 22 23 25 28 29 30 26 27 34 35 36 4 21 13 41 42; @ intercept indicator; intercept @; if rob.==2; @ use the core numbers @ x__=dat[.,7:11 13:34 36:38 40:cols(dat)]~ones(rows(dat),1); @ 12/13: CPI/Core; 35/36: PPI/Core; 39/40: Sales/ex.Auto @ let seqa_=1 2 3 6 5 8 7 9 10 11 12 31 32 33 14 15 16 17 24 18 19 20 22 23 25 28 29 30 26 27 34 35 36 4 21 13 41 42; @ intercept indicator; intercept @ endif; @ turn missing values into zero: for regressor matrix x only @ x__=missrv(x__,0); @ turn empty cells into zeros @ @ reverse order @ y_=rev(y__); x_=rev(x__); @ obs are now stacked like this: 2003|2002|...|1997 @ seqas=seqa(1,1,rows(dat)); @ index that includes missing observations @ y_=missrv(y_,-9); ymiss=indexcat(y_,-9); @ positions of missing values @ y=delif(y_,y_.==-9); x=delif(x_,y_.==-9); seqam=delif(seqas,y_.==-9); if rob.==1; y =delif(y,x[.,cols(x)-1].==1); seqam=delif(seqam,x[.,cols(x)-1].==1); ymiss=ymiss|indexcat(x[.,cols(x)-1],1); x =delif(x,x[.,cols(x)-1].==1); endif; wks=rows(seqas); @ number of obs in time, including missing values @ @ wks=rows(y); @ l=floor(4.*((wks./100).^(2./9))); @ lag for Ljung-Box and Newey-West @ /* ************** deal with speech/testimony indicator ************* */ z= x[.,cols(x)-2:cols(x)]; @ do not exlude speech/testimony indicator: next to last column @ seqaz=seqa_[cols(x)-2:cols(x)]; zex_=(z[.,1].==0)+(z[.,2].==0); zex=(zex_.==2); /* z=delif(z,zex); "number of nonzero observations"; rows(z); wait; */ @ create intercept indicator variable @ z=z[.,1 2]~zex~z[.,3]; @ two regressors (surprise, speech dummy), 0/1 intercept indicator, intercept @ z[.,1]=abs(z[.,1]); @ square the surprise variable or take absolute value @ @ format /rd 10,6; z; wait; @ seqaz=seqaz[1 2]|41|seqaz[3]; "number of nonzero observations:" rows(z)-sumc(z[.,3]); x_= x[.,1:cols(x)-2 cols(x)]; @ exlude speech/testimony indicator: next to last column @ seqax=seqa_[1:cols(x)-2 cols(x)]; @ create intercept indicator variable @ xex=(stdc(x_[.,1:cols(x_)-1]').==0); x_=x_[.,1:cols(x_)-1]~xex~x_[.,cols(x_)]; seqax=seqax[1:rows(seqax)-1]|41|seqax[rows(seqax)]; /* ************************** core program ************************* */ y_=y; @ modelling heteroscedasticity: includes speech/testimonry indicator @ z_=z; @ dataset @ dst=y_~x_~z_; @ z: regressors in the variance part of regression @ rx=cols(x_); @ number of regressors in main regression @ rz=cols(z_); @ number of regressors in variance regression @ nobs=rows(dst); @ number of observations @ clear y_,x_,z_; /* format /rd 8,6; dst; omat=dst; mask=ones(1,2); let fmt[2,3] = "*.*lf" 8 3 "*.*lf" 8 3; call printfm(omat,mask,fmt); */ @ getting starting values @ y=dst[.,1]; @ dependent variable @ x=dst[.,2:(rx+1)]; @ main regression @ b=inv(x'x)*x'y; res=y-x*b; sige=(res'res)./rows(y); bvar_=inv(x'x).*sige; @ uncorrected @ @ ------------------- White-correction ----------------- @ @ Greene, 2nd ed., page 391 @ hat=res.^2; s0=zeros(cols(x),cols(x)); i=0; do until i.==cols(x); @ across all regressors @ i=i+1; s0[i,.]=(x[.,i]'.*hat')*x; endo; @ i @ clear hat; hat=diagrv(reshape(0,rows(x),rows(x)),res.^2); /* bvar=inv(x'x)*x'*hat*x*inv(x'x); bvar=inv(x'x)*s0*inv(x'x); */ mat_=inv(x'x); @ bvar=mat_*s0*mat_; White-corrected estimator of covariance matrix @ @ do loop for the matrix operation above @ mat_s0=reshape(0,rows(mat_),cols(s0)); i1=0; do while i10)); negmed=median(selif(z[.,cols(x_)-2],z[.,cols(x_)-2].<0)); @ posmed; negmed; wait; @ zpos_=z; zneg_=z; zpos_[.,cols(x_)-2]= (z[.,cols(x_)-2].>posmed); zneg_[.,cols(x_)-2]=-(z[.,cols(x_)-2].0. the larger, the more smoothing. ** =0 for automatic calculation of density. ** =-1 for automatic calculation for description. ** ** _strt=0; x axis minimum. (if _strt=_endd, set at min and max). ** _endd=0; x axis maximum. ** _pts=100; number of points to plot ** _whiskr=-1; -1 = draw whiskers at 1/10th size; ** >0 = draw whiskers at size _whiskr; ** 0 = do not draw whiskers ** Whiskers are always drawn at y==0, so you may have to ** use ytics to scale the y-axis. ** _jitter=0; 0=nothing extra. #=add # jitter to each ** whisker if _whiskr/=0;. ** ** let _kern=E; kernel type. N=normal, E=Epanechnikov, ** B=biweight, T=triangular, R=rectangular ** TN=Doubly Truncated Normal ** for option _kern=="TN", ** _Tleft=_strt; truncate distribution on left at _Tleft ** _Tright=_endd; truncate distribution on right at _Tright ** ** _output = 1; 1 = print density plot (default); 0 = do not print. ** ** Technical Reference: ** B.W. Silverman. 1986. _Density Estimation for Statistics ** and Data Analysis_. London: Chapman and Hall. ** ** Application (code developed for): ** King, Gary. "Constituency Service and Incumbency Advantage," British ** Journal of Political Science, 21, 1 (January, 1991): 119-128, ** (replication dataset: ICPSR s1108) */ declare matrix _smth ?=0; declare matrix _strt ?= 0; declare matrix _endd ?= 0; declare matrix _pts ?= 2000; declare matrix _Tleft ?= 0; declare matrix _Tright ?= 0; declare string _kern ?= "N"; declare matrix _whiskr ?= 0; declare matrix _jitter ?= 0; declare matrix _output ?= 1; external proc code,xy,seqas_; external matrix _pline; @ Kernels @ @ arguments of kernels: z=input value, m=mean, h=smoothing parameter _smth @ proc kerneln(z,m,h);local res;z=(z-m)./h; @ NORMAL kernel @ res=(1./sqrt(2*pi))*exp(-(1/2).*(z^2));retp(res);endp; proc kernelTN(z,m,h,Tleft,Tright); local t,tl,res,tr,zz;zz=(z-m)./h; @ TRUNCATED NORMAL kernel @ tl=(Tleft-m)./h; tr=(Tright-m)./h; t=((z.>Tleft).and (z.endd;errorlog "error: _strt>_endd";end; elseif strt==endd;strt=minc(y);endd=maxc(y);endif; pts=int(_pts); if pts<=2;errorlog "_pts must be greater than 2. Try _pts=100;";endif; smth=_smth; if (smth<0).and(smth/=-1);errorlog "_smth must be -1 or > than 0";stop; elseif smth==0; py=sortc(y,1); std=minc((py[int(3*rows(py)/4)]-py[int(rows(py)/4)])/1.34|stdc(py)); smth=0.9*std*(rows(py)^(-0.2)); smth=(4./3).^(-0.2).*stdc(py).*(rows(py).^(-0.2)); elseif smth==-1; py=sortc(y,1); std=minc((py[int(3*rows(py)/4)]-py[int(rows(py)/4)])/1.34|stdc(py)); smth=0.9*std*(rows(py)^(-0.2))/2; endif; kern=_kern; Tleft=0;Tright=0; if kern$=="TN"; if _Tleft==_Tright; Tleft=strt; Tright=endd; else; Tleft=_Tleft; Tright=_Tright; endif; endif; {px,py}=density(y,strt,endd,pts,smth,kern,Tleft,Tright); std=rndu(rows(y),1)*_jitter-(_jitter/2); y=y+std; if _output==1; if _whiskr==-1; os=ones(rows(y),1); _pline=os~ (os*6)~ y~ (os*0)~ y~ (os*(maxc(py)/15))~ os~ (os*15)~(os*0); clear os; elseif _whiskr>0; os=ones(rows(y),1); _pline=os~ (os*6)~ y~ (os*0)~ y~ (os*_whiskr)~ os~ (os*15)~(os*0); clear os; endif; xy(px,py); format/rd 5,4; if rows(_smth)==1;?;"Smoothing Parameter: _smth=";;smth;endif; endif; retp(px,py);endp; /* ** (C) Copyright 1999 Gary King ** All Rights Reserved. ** http://GKing.Harvard.Edu, King@Harvard.Edu ** Department of Government, Harvard University ** ** creates vector of evenly spaced points ** ** y = seqas_(a,b,n); ** ** y = vector of n points evenly spaced between a and b. Y does not ** include a or b */ proc seqas_(strt,endd,pts); local res; res=(endd-strt)/pts; res=seqa(strt+0.005*res,res,pts); retp(res); endp; /* ** optmum.src - General Nonlinear Optimization ** (C) Copyright 1988-2000 by Aptech Systems, Inc. ** All Rights Reserved. ** ** This Software Product is PROPRIETARY SOURCE CODE OF APTECH ** SYSTEMS, INC. This File Header must accompany all files using ** any portion, in whole or in part, of this Source Code. In ** addition, the right to create such files is strictly limited by ** Section 2.A. of the GAUSS Applications License Agreement ** accompanying this Software Product. ** ** If you wish to distribute any portion of the proprietary Source ** Code, in whole or in part, you must first obtain written ** permission from Aptech Systems. ** ** Written by Ronald Schoenberg ** ** CONTENTS LINE ** -------- ---- ** PROC OPTMUM 29 ** Global Variables 69 ** Using OPTMUM recursively 232 ** Source Code 249 ** **-------------------**------------------**-------------------**-----------** **-------------------**------------------**-------------------**-----------** ** ** PROC OPTMUM ** ** FORMAT ** { x,f,g,retcode } = optmum_(&fct,x0) ** ** INPUT ** ** &fct - pointer to a procedure that computes the function to ** be minimized. This procedure must have one input ** argument, a vector of parameter values, and one ** output argument, the value of the function evaluated ** at the input vector of parameter values. ** ** x0 - vector of start values ** ** OUTPUT ** x - vector of parameters at minimum ** f - function evaluated at x ** g - gradient evaluated at x ** retcode - return code: ** ** 0 normal convergence ** 1 forced exit ** 2 maximum number of iterations exceeded ** 3 function calculation failed ** 4 gradient calculation failed ** 5 Hessian calculation failed ** 6 step length calculation failed ** 7 function cannot be evaluated at initial parameter values ** 8 number of elements in the gradient vector inconsistent ** with number of starting values ** 9 gradient function returned a column vector rather than ** the required row vector ** 10 secant update failed ** 20 Hessian failed to invert ** ** **-------------------**------------------**-------------------**-----------** **-------------------**------------------**-------------------**-----------** ** ** GLOBAL VARIABLES LINE ** ** (default values in parantheses) ** __title - string, title ("") 84 ** _opalgr - scalar, optimization algorithm (2) 86 ** _opstep - scalar, selects type of step length (2) 93 ** _opshess - scalar or KxK matrix, selects starting Hessian (0) 105 ** _opfhess - KxK matrix, contains final Hessian 111 ** _opmbkst - scalar, # of backsteps in computing steplength (10) 114 ** _opgtol - scalar, convergence tolerance for gradient (1e-5) 120 ** _opgdprc - scalar, pointer to gradient procedure (0) 124 ** _ophsprc - scalar, pointer to Hessian procedure (0) 143 ** _opgdmd - scalar, numerical gradient method (1) 158 ** _opparnm - Kx1 Char. vector, parameter names (0) 163 ** _opdfct - scalar, criterion for change in function (.001) 165 ** _opditer - scalar, # of iters to switch algorithms (20) 169 ** _opmiter - scalar, maximum number of iterations (1e+5) 173 ** _opmtime - scalar, maximum time in iterations in minutes (1e+5) 175 ** _oprteps - scalar, radius of random direction (0) 183 ** _opusrch - scalar, flag for user-controlled line search (0) 188 ** _opdelta - scalar, floor of Hessian eigenvalues in NEWTON (.1) 192 ** _opstmth - string, contains starting method ("") 196 ** _opmdmth - string, contains "middle" method ("") 204 ** _opkey - scalar, keyboard capture flag (1) 210 ** _opgrdh - scalar, increment size for computing gradient (0) 219 ** ** __title - string, title of run ** ** _opalgr - scalar, indicator for optimization method: ** = 1 SD (steepest descent - default) ** = 2 BFGS (Broyden, Fletcher, Goldfarb, Shanno) ** = 3 Scaled BFGS ** = 4 Self-Scaling DFP (Davidon, Fletcher, Powell) ** = 5 NEWTON (Newton-Raphson) ** = 6 Polak-Ribiere Conjugate Gradient ** ** _opstep - scalar, indicator determining the method for computing step ** length. ** = 1, steplength = 1 ** = 2, STEPBT (default) ** = 3, golden steplength. ** = 4, Brent ** ** Usually _opstep = 2 will be best. If the optimization bogs ** down try setting _opstep = 1 or 3. _opstep = 3 will generate ** slow iterations but faster convergence and _opstep = 1 will ** generate fast iterations but slower convergence. ** ** _opshess - scalar or KxK matrix, determines the starting hessian for ** BFGS, DFP, and Newton methods. ** = 0, start with identity matrix (default) ** = 1, computing starting hessian ** = matrix, user-defined starting hessian. ** ** _opfhess - KxK matrix, contains the final Hessian, if one has been ** calculated. If the inversion of the Hessian fails during ** NEWTON iterations this matrix can be analyzed for linear ** dependencies which will suggest tactics for re-specifying ** the model. ** ** _opmbkst - scalar, maximum number of backsteps taken to find step length. ** Default = 10. ** ** _opgtol - scalar, convergence tolerance for gradient of estimated ** coefficients. Default = 1e-5. When this criterion has been ** satisifed OPTMUM will exit the iterations. ** ** _opgdprc - scalar, pointer to a procedure that computes the gradient of the ** function with respect to the parameters. For example, ** the instruction: ** ** _opgdprc=&gradproc ** ** will tell OPTMUM that a gradient procedure exists as well ** where to find it. The user-provided procedure has a ** single input argument, a vector of parameter values, and ** a single output argument, a vector of gradients of the ** function with respect to the parameters evaluated at the ** vector of parameter values. For example, suppose the ** procedure is named gradproc and the function is a quadratic ** function with one parameter: y=x^2+2*x+1, then ** ** proc gradproc(x); retp(2*x+2); endp; ** ** Default = 0, i.e., no gradient procedure has been provided. ** ** _ophsprc - scalar, pointer to a procedure that computes the hessian, ** i.e., the matrix of second order partial derivatives of the ** function with respect to the parameters. For example, the ** instruction: ** ** _ophsprc=&hessproc; ** ** will tell OPTMUM that a procedure has been provided for the ** computation of the hessian and where to find it. The ** procedure that is provided by the user must have a single ** input argument, the vector of parameter values, and a single ** output argument, the symmetric matrix of second order ** derivatives of the function evaluated at the parameter ** values. ** ** _opgdmd - scalar, method for computing numerical gradient. ** = 0, central difference ** = 1, forward difference (default) ** = 2, forward difference, Richardson Extrapolation ** ** _opparnm - Kx1 character vector, parameter labels. ** ** _opdfct - scalar, criterion for change in function which will cause ** OPTMUM to switch algorithms when __design is nonzero. ** Default = .001. ** ** _opditer - scalar, criterion for maximum number of iterations before ** switching algorithms when __design is nonzero. ** Default = 20. ** ** _opmiter - scalar, maximum number of iterations. Default = 1e+5. ** ** _opmtime - scalar, maximum time in iterations in minutes. ** Default = 1e+5, about 10 weeks. ** ** _oprteps - scalar, if _oprteps is set to a nonzero value (1e-2, say) ** and all other line search methods fail then ** OPTMUM will attempt a random direction with radius ** determined by _oprteps. ** ** _opusrch - scalar, if nonzero and if all other line search methods fail ** OPTMUM will enter an interactive mode in which the ** user can select a line search parameter. ** ** _opdelta - scalar, used in NEWTON. The eigenvalues of the Hessian ** will be constrained to be greater than this value. ** If set to zero the constraint will be disabled. ** ** _opstmth - String, contains starting methods for algorithm, step ** length, and Hessian. For example, ** ** _opstmth = "NEWTON BRENT"; ** ** will cause OPTMUM to start with the NEWTON algorithm and ** the BRENT step length method. ** ** _opmdmth - String, contains "middle" methods for algorithm, step ** length, and Hessian. OPTMUM will switch to the methods ** in _opmdmth either when the functions fails to change by ** _opdfct, or when _opditer iterations have occured. ** ** _opkey - scalar, flag controlling the keyboard capture feature. During ** the iterations OPTMUM will respond to the keyboard in order to ** allow the user to modify global variables on the fly. If ** OPTMUM is being run recursively, however, (i.e., OPTMUM is ** being called inside of the user procedure) then the keyboard ** capture feature should be turned off for the version of ** OPTMUM being called inside the user procedure which will ** permit the outer version of OPTMUM to retain keyboard ** control. ** ** _opgrdh - scalar, increment size for computing gradient. ** ** **-------------------**------------------**-------------------**-----------** **-------------------**------------------**-------------------**-----------** ** ** Calling OPTMUM recursively ** ** The procedure provided by the user for computing the function to ** to be minimized can itself call OPTMUM. In fact the number of nested ** levels is limited only by the amount of workspace memory. Each level ** will also contain its own set of global variables. Thus nested versions ** can have their own set of attributes and optimization methods. ** It will be important to call OPTSET for all nested versions, and ** generally if you wish the outer version of OPTMUM to retain control ** over the keyboard you will need to set _opkey to zero for all the ** nested versions. ** */ /*-------------------**------------------**-------------------**-----------** **-------------------**------------------**-------------------**-----------*/ /* SOURCE CODE */ #include optmum.ext; #include gauss.ext; proc (4) = optmum_(fnct,x0); local x,f0,g,retcode; local Lopfhess,Lopitdta,LLoutput; #ifUNIX LLoutput = __output /= 0; #else LLoutput = __output; #endif { x,f0,g,retcode,Lopfhess,Lopitdta } = _optmum(fnct,x0, _opalgr, _opdelta, _opdfct, _opditer, _opgdmd, _opgdprc, _opgrdh, _opgtol, _ophsprc, _opkey, _opmbkst, _opmdmth, _opmiter, _opmtime, _opmxtry, _opparnm, _oprteps, _opshess, _opstep, _opstmth, _opusrch, _opusrgd, _opusrhs, LLoutput, __title ); _opfhess = Lopfhess; _opitdta = Lopitdta; retp(x,f0,g,retcode); endp; proc(0) = optset; gausset; _opalgr = 2; /* optimization algorithm */ _opparnm = 0; /* parameter names */ _opstep = 2; /* selects type of step length */ _opshess = 0; /* selects starting hessian */ _opmbkst = 10; /* # of backsteps in computing steplength */ _opgtol = 1e-5; /* convergence tolerance for gradient */ _ophsprc = 0; /* procedure to compute hessian */ _opgdprc = 0; /* procedure to compute gradient */ _opgdmd = 0; /* numerical gradient method */ _opditer = 20; /* # iters to switch algorithms for _opmdmth */ _opdfct = 0.001; /* % change in function for _opmdmth */ _opmiter = 1e+5; /* maximum number of iterations */ _opitdta = { 0,0,0 }; _oprteps = .01; _opusrch = 0; _opdelta = .1; _opmxtry = 100; _opfhess = 0; _opusrgd = 0; _opusrhs = 0; _opstmth = ""; _opmdmth = ""; _opkey = 1; _opgrdh = 0; endp; proc(4) = optprt(x,f,g,ret); local lbl,mask,fmt; print; call header("OPTMUM","",_op_ver); print; print "return code = " ftos(ret,"%*.*lf",4,0); if ret == 0; print "normal convergence"; elseif ret == 1; print "forced termination"; elseif ret == 2; print "maximum number of iterations exceeded"; elseif ret == 3; print "function calculation failed"; elseif ret == 4; print "gradient calculation failed"; elseif ret == 5; print "Hessian calculation failed"; elseif ret == 6; print "step length calculation failed"; elseif ret == 7; print "function cannot be evaluated at initial parameter values"; elseif ret == 8; print "number of elements in the gradient vector inconsistent"; print "with number of starting values"; elseif ret == 9; print "gradient function returned a column vector rather than"; print "the required row vector"; elseif ret == 11; print "maximum time exceeded"; elseif ret == 20; print "Hessian failed to invert"; endif; print; print "Value of objective function " ftos(f,"%*.*lf",15,6); print; print "Parameters Estimates Gradient"; print "-----------------------------------------"; if rows(g) /= rows(x); g = miss(zeros(rows(x),1),0); endif; if _opparnm $== 0; lbl = 0 $+ "P" $+ ftocv(seqa(1,1,rows(x)),2,0); else; lbl = _opparnm; endif; mask = 0~1~1; let fmt[3,3] = "-*.*s" 9 8 "*.*lf" 14 4 "*.*lf" 14 4; call printfm(lbl~x~g,mask,fmt); kernel01x=x; save kernel01x; print; print "Number of iterations " ftos(_opitdta[1],"%*.*lf",5,0); print "Minutes to convergence " ftos(_opitdta[2],"%*.*lf",10,5); retp(x,f,g,ret); endp;