Visualizing time series data code extension

library tsmt;

//Load data
fname = getGAUSShome $+ "pkgs\\tsmt\\examples\\wpi1.dat";

//Load data
y = loadd(fname, "ln_wpi");

//Take first differences
y_diff = vmdiffmt(y, 1);

//Set up plot format
struct plotControl myplot;
myplot = plotGetDefaults("XY");

//Turn off grid
plotSetGrid(&myPlot, "off");

//Title
plotSetTitle(&myPlot, "U.S. World Price Index ",
               "Helvetica Neue", 18);

//Y-axis label
plotSetYLabel(&myPlot, "ln(wpi)",
                "Helvetica Neue", 14);

//Start Date
dtstart = 196001;

//Frequency (quarterly)
freq = 4;

//PlotLayout
plotlayout(2, 1, 1);

//Plot level data
plotTS(myPlot, dtstart, freq, y);

//PlotLayout
plotlayout(2, 1, 2);

//Change itle
plotSetTitle(&myPlot, "",
               "Helvetica Neue", 18);

//Change Y-axis label
plotSetYLabel(&myPlot, "First differences ln(wpi)",
                "Helvetica Neue", 14);

//Plot level data
plotTS(myPlot, dtstart, freq, y_diff);

Have a Specific Question?

Get a real answer from a real person

Need Support?

Get help from our friendly experts.

Try GAUSS for 14 days for FREE

See what GAUSS can do for your data

© Aptech Systems, Inc. All rights reserved.

Privacy Policy