Download EViews 8 User's Guide I - FOBTECH Remote Services

Transcript
124—Chapter 5. Basic Data Handling
series xsum = x
smpl @first+1 @last
xsum = xsum(-1) + x
(see “Basic Assignment” on page 176). The first two commands initialize the cumulative
sum for the first observation in each cross-section. The last two commands accumulate the
sum of values of X over the remaining observations.
Similarly, if you wish to estimate your equation on a subsample of data and then perform
cross-validation on the last 20 observations, you may use the sample defined by,
smpl @first @last-20
to perform your estimation, and the sample,
smpl @last-19 @last
to perform your forecast evaluation.
While the use of sample offsets is generally straightforward, there are a number of important
subtleties to note when working with irregular dated data and other advanced workfile
structures (“Advanced Workfiles” on page 249). To understand the nuances involved, note
that there are three basic steps in the handling of date offsets.
First, dates used for the starts of date pairs are rounded down to the first instance of the corresponding date in the workfile regular frequency, while dates used for the ends of date
pairs are rounded up to the last instance of the corresponding date in the regular frequency.
If date pairs are specified in the workfile frequency (e.g., the pair “1990 2000” is used in an
annual workfile), this step has no effect.
Next, EViews examines the workfile frequency date pair to determine whether the sample
dates fall within the range of the observed dates in the workfile, or whether they fall outside
the observed date range. The behavior of sample offsets differs in the two cases.
For simplicity of discussion, assume first that both dates fall within the range of observed
dates in the workfile. In this case:
• EViews identifies base observations consisting of the earliest and latest workfile
observations falling within the date pair range.
• Offsets to the date pair are then applied to the base observations by moving through
the workfile observations. If, for example, the offset for the first element of a date pair
is “+1”, then the sample is adjusted so that it begins with the observation following
the base start observation. Similarly, if the offset for the last element of a date pair is
“-2”, then the sample is adjusted to end two observations prior to the base end observation.