RATS 10.1
RATS 10.1

Instructions /

EXP, SQRT, MOVE Instructions

Home Page

← Previous Next →

EXP         series start end newseries newstart

SQRT        series start end newseries newstart

MOVE        series start end newseries newstart

These are convenience instructions as you can do (effectively) the same thing using SET. The LOG instruction is similar, but is used often enough that we listed it separately. EXP takes the inverse natural log a series (that is returns \(e^{X_t}\)), SQRT the square root, and MOVE simply copies information around. Of the three, MOVE is the one most likely to be helpful if you need to shift information to a different set of entries (that is, newstart is different from start), as the SET instruction for doing that can be a bit hard to read if it isn't just a lag shift.

Parameters

series

source series

start, end

range to transform, by default range of series

newseries

result series, by default, same as series

newstart

start for newseries, by default start

Examples

exp x / ex

set ex = exp(x)

 

These are equivalent instructions for making EX equal to the exponential of X.



 

move beer 1991:1 1991:12 b1991 1

move beer 1992:1 1992:12 b1992 1

move beer 1993:1 1993:12 b1993 1

move beer 1994:1 1994:12 b1994 1

move beer 1995:1 1995:8  b1995 1

graph(footer="Figure 2-2 Seasonal Plot of Beer Production",$

  xlabels=||"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"||) 5

# b1991

# b1992

# b1993

# b1994

# b1995

 

This creates a graph of data from five years but with the five years stacked on top of each other across the months (so the time axis is really just the twelve months of the year). To do that, it's necessary to rearrange the data so that the 12 entries for each year go into entries 1 to 12. The SET instruction equivalent to the second MOVE would be something like

 

set b1992 1 12 = beer(1992:1-1+t)

 


Copyright © 2025 Thomas A. Doan