/* THIS IS C:\REVIEW\NEELY\REALIGN\REVGRAPH.PRG */ /* THIS PROGRAM USES GAUSS TO CREATE THE THREE GRAPHS USED IN CHRIS NEELY'S */ /* REVIEW ARTICLE, TO BE PUBLISHED IN THE ST. LOUIS REVIEW SEPT/OCT 1994. */ new; library pgraph; /* THE DATA IS READ HERE AND MODIFIED TO REMOVE OR CHANGE EXTRANEOUS POINTS */ /* The text files contain three variables, */ /* the 3 month euro-market interest rate, */ /* the 'spot' exchange rate against the $US */ /* and the central exchange rate against */ /* the Ecu. The data are March 13, 1979 to July 31,1993 */ /* January 2, 1985 is ob # 2123 in the unmodified data. */ load france[5254,3] = c:\review\neely\realign\frang.txt; load germany[5254,3] = c:\review\neely\realign\germg.txt; dates = seqa(1979+(2.4/12),1/365,rows(germany)); trf3=(france[.,3].==9999); /* The 1st lines in each of the next 2 groups */ trf2=(france[.,2].==9999); /* are used to help remove the weekends. The */ trf1=(france[.,1].==9999); /* weekend have values of 9999. */ trg3=(germany[.,3].==9999); /* The 2nd lines in each of these 2 groups */ trg2=(germany[.,2].==9999); /* will be used to transform missing values */ trg1=(germany[.,1].==9999); /* so that gauss can manipulate the data. */ /* The 3rd lines in each of these 2 groups */ /* will be used to transform missing values */ /* so that gauss can manipulate the data. */ fr2=missex(france[.,2],trf2); /* These 3 lines use the 2nd lines from the */ ge2=missex(germany[.,2],trg2); /* above groups to transform the missing */ fr1=missex(france[.,1],trf1); /* These 3 lines use the 3rd lines from the */ ge1=missex(germany[.,1],trg1); /* above groups to transform the missing */ fran=fr1~fr2~france[.,3]; germ=ge1~ge2~germany[.,3]; fr3=delif(fran,trf3); /* These 3 lines use the 1st lines in the */ ge3=delif(germ,trg3); /* above groups to delete the weekends from */ dates2 = delif(dates,trg3); /* THE CODING FOR ALL THE FIGURES BEGINS HERE */ /* The following code modifies the data to be used in Figure 1 */ trend = dates2; ffge = fr3[.,1] - ge3[.,1]; rowsvec = rows(ffge); cp = ge3[.,3] ./ fr3[.,3]; top = 1.0225 * cp; bottom = .9775 * cp; dmff = (ge3[.,2] ./ (fr3[.,2])); dmff = dmff ~ top ~ bottom ~ cp; dmff1 = dmff ./ (dmff[1,4] .* ones(1,4)); dmff2 = ln(dmff1); /* Find the realignments */ dcp = cp[2:rows(cp),1] - cp[1:rows(cp)-1,1]; indx = indexcat(abs(dcp),.00001|25); datz = trend[indx,1]; datz = ones(rowsvec,rows(datz)) .* datz'; dist = maxc(maxc(ffge)) - minc(minc(ffge)); ydatz = seqa(minc(minc(ffge)),dist/rowsvec,rowsvec); ydatz = ones(rowsvec,cols(datz)) .* ydatz; begwind; window(2,1,0); cnvtype= "3"; @ conversion file type @ cnvnam = "c:\\review\\neely\\realign\\dmffxi.grf"; wtime = "5"; @ time to wait, in seconds @ cmdstr = " -c=" $+ cnvtype $+ " -cf=" $+ cnvnam $+ " -w=" $+ wtime; _pdate = 0; _pltype = 6 * ones(cols(dmff2),1); graphprt(cmdstr); setwind(1); title("DM per franc, March 1979 to July 1993"); xlabel("Year"); ylabel("Ln Levels of Normalized Exchange Rates"); xy(trend,dmff2); screen off; output file = c:\review\neely\realign\years.txt reset; output on; trend; output off; screen on; screen off; output file = c:\review\neely\realign\dmff2.txt reset; dmff2; output off; screen on; nextwind; title("French - German 3 month interest rates, March 1979 to July 1993"); xlabel("Year"); ylabel("Interest Rate Differentials"); _pltype = 6 * ones(cols(ffge)+cols(ydatz),1); xy(trend~datz,ffge~ydatz); screen off; output file = c:\review\neely\realign\ffge.txt reset; ffge; output off; screen on; screen off; output file = c:\review\neely\realign\indx.txt reset; indx; output off; screen on; endwind; /* The following code modifies the data to be used in Figure 2 */ dt = 100 * ln(dmff[.,1] ./ cp); intdif = .25 * (ge3[.,1] - fr3[.,1]); lack = dt - intdif; rowsvec = rows(dt); /* Find the realignments */ datz1 = trend[indx,1]; datz2 = ones(rowsvec,rows(datz1)) .* datz1'; dist = maxc(maxc(lack)) - minc(minc(lack)); ydatz1 = seqa(minc(minc(lack)),dist/rowsvec,rowsvec); ydatz2 = ones(rowsvec,cols(datz2)) .* ydatz1; cnvtype= "3"; @ conversion file type @ cnvnam = "c:\\review\\neely\\realign\\UIP1.grf"; wtime = "5"; @ time to wait, in seconds @ cmdstr = " -c=" $+ cnvtype $+ " -cf=" $+ cnvnam $+ " -w=" $+ wtime; _pdate = 0; _pltype = 6*ones(cols(lack),1)|1*ones(cols(ydatz2),1)|6; _plwidth = 0*ones(cols(lack),1)|1*ones(cols(ydatz2),1)|2; graphprt(cmdstr); title("DM/franc within the band minus adjusted interest differentials,\L March 1979 to July 1993"); xlabel("Year"); ylabel("In Percentage Terms"); xy(trend*ones(cols(lack),1)~datz2~trend,lack~ydatz2~zeros(rows(lack),1)); screen off; output file = c:\review\neely\realign\lack.txt; output on; lack; output off; screen on; end;