OPEN DATA "\\myfiles\2018 nonlinear paper revision\RATS_real time data for paper(shadow rate)_USUK.xls" CALENDAR 1979 1 4 ALL 2015:04 DATA(FORMAT=XLS,ORG=COLUMNS) 1979:01 2015:04 uk_ex uk_int us_int $ uk_qdy us_qdy uk_inf us_inf uk_realex us_qds uk_qds uk_qdh us_qdh print 2005:1 2006:1 us_inf **************************************************** *data transform set y = uk_ex set diffinf =us_inf - uk_inf set diffqdy = us_qdy-uk_qdy set diffint = us_int-uk_int set diffws = us_qds-uk_qds set diffwh = us_qdh-uk_qdh set realex = uk_realex **************************************************** *Linearity test on STR models set y = uk_ex set a1 = diffinf{1} set a2 = diffint{2} set a4 = diffqdy{1} set a5 = diffws{1} set a6 = diffwh{1} set a7 = realex{1} linreg y 1980:1 2015:4 # constant diffinf{1} diffint{2} diffqdy{1} diffwh{1} diffws{1} realex{1} @regSTRTest(threshold=a1, d=0) y @regSTRTest(threshold=a2, d=0) y @regSTRTest(threshold=a4, d=0) y @regSTRTest(threshold=a5, d=0) y @regSTRTest(threshold=a6, d=0) y @regSTRTest(threshold=a7, d=0) y @regSTRTest(threshold=volatility, d=0) y **************************************************************************** ***Estimation of the nonlinear model ******The ESTR model*** ** **************************************************************************** * equation standard y # constant diffinf{1} diffqdy{1} diffint{2} diffws{1} diffwh{1} realex{1} equation transit y # constant diffinf{1} diffqdy{1} diffint{2} diffws{1} diffws{1} realex{1} * dec vector phi1 phi2 frml(equation=standard,vector=phi1) phi1f frml(equation=transit,vector=phi2) phi2f nonlin(parmset=regparms) phi1 phi2 * nonlin(parmset=starparms) gamma c * frml festar = 1.0-exp(-gamma*(diffint{2}-c)^2) frml estar y = g=festar,phi1f+g*phi2f stats diffint compute gamma=1.0/%variance compute c = %mean ******************************************************************** * Estimate the model with the ESTAR parameters fixed. * nlls(parmset=regparms,frml=estar) y * * Then with the STAR parameters freed * nlls(parmset=regparms+starparms,frml=estar) y / resids ******************************************************************** *Grid search on c and gamma compute agrid=%seqa(1, 1, 10) dec real ggrid stats(fractiles) diffint compute grid=%seqa(%fract25,(%fract75-%fract25)/49.0,50) dec real cgrid compute minrss=1.e+100 nonlin(parmset=starparms) gamma=ggrid c=cgrid dofor ggrid =agrid dofor cgrid = grid nlls(frml=estar,parmset=regparms+starparms,noprint) y if %rss