UCM Procedure

Example 30.2 Variable Star Data

The series in this example is studied in detail in Bloomfield (2000). This series consists of brightness measurements (magnitude) of a variable star taken at midnight for 600 consecutive days. The data can be downloaded from a time series archive maintained by the University of York, England (http://www.york.ac.uk/depts/maths/data/ts/welcome.htm (series number 26)). The following DATA step statements read the data in a SAS data set:


data star;
   input magnitude @@;
   day = _n_;
   format day best4.;
datalines;
  25  28  31  32  33  33  32  31  28   25   22   18
  14  10   7   4   2   0   0   0   2    4    8   11
  15  19  23  26  29  32  33  34  33   32   30   27
  24  20  17  13  10   7   5   3   3    3    4    5
   7  10  13  16  19  22  24  26  27   28   29   28

   ... more lines ...   

The following statements use the TIMESERIES procedure to get a timeseries plot of the series (see Output 30.2.1):


proc timeseries data=star plot=series;
   var magnitude;
run;

Output 30.2.1: Plot of Star Brightness on Successive Days

Plot of Star Brightness on Successive Days


The plot clearly shows the cyclic nature of the series. Bloomfield shows that the series is very well explained by a model that includes two deterministic cycles that have periods 29.0003 and 24.0001 days, a constant term, and a simple error term. He also mentions the difficulty involved in estimating the periods from the data (Bloomfield 2000, Chapter 3). In his case the cycle periods are estimated by least squares, and the sum of squares surface has multiple local optima and ridges. The following statements show how to use the UCM procedure to fit this two-cycle model to the series. The constant term in the model is specified by holding the variance parameter of the level component to 0.


/* Load data into mylib */
data mylib.star;
   set star;
run;

proc ucm data= mylib.star;
   id day interval=obs;
   model magnitude;
   irregular;
   level var=0 noest;
   cycle;
   cycle;
   estimate;
run;

The final parameter estimates and the goodness-of-fit statistics are shown in Output 30.2.2 and Output 30.2.3, respectively. The model fit appears to be good.

Output 30.2.2: Two-Cycle Model: Parameter Estimates

The UCM Procedure

Final Estimates of the Free Parameters
ComponentParameterEstimateApprox
Std Error
t ValueApprox
Pr > |t|
IrregularError Variance0.092570.005417.19<.0001
Cycle_1Damping Factor1.000000.00005519514<.0001
Cycle_1Period29.000360.002312770.4<.0001
Cycle_1Error Variance0.000008820.00001.670.0944
Cycle_2Damping Factor1.000000.00004718334<.0001
Cycle_2Period24.000110.001912547.2<.0001
Cycle_2Error Variance0.000005350.00001.500.1330


Output 30.2.3: Two-Cycle Model: Goodness of Fit

Fit Statistics Based on Residuals
Mean Squared Error0.12072
Root Mean Squared Error0.34745
Mean Absolute Percentage Error2.65141
Maximum Percent Error36.38991
R-Square0.99850
Adjusted R-Square0.99849
Random Walk R-Square0.97281
Amemiya's Adjusted R-Square0.99847
Number of non-missing residuals used for computing the fit statistics = 599


A summary of the cycles in the model is given in Output 30.2.4.

Output 30.2.4: Two-Cycle Model: Summary

NameTypeperiodRhoErrorVar
Cycle_1Stationary29.000361.000000.00000882
Cycle_2Stationary24.000111.000000.00000535


Note that the estimated periods are the same as in Bloomfield’s model, the damping factors are nearly equal to 1.0, and the disturbance variances are very close to 0, implying persistent deterministic cycles. In fact, this model is identical to Bloomfield’s model.

Finally, Output 30.2.5 shows the likely outlying observations that do not conform to the fitted model. The first outlier in this table, day 301, is also flagged by Bloomfield (according to his zero-based index system, it is day 300).

Output 30.2.5: Two-Cycle Model: Outlier Summary

Outlier Summary
dayBreak TypeEstimateStandard
Error
Chi-SquareDFPr > ChiSq
301Additive Outlier0.830880.30647.3510.0067
407Additive Outlier0.829050.30657.3210.0068
351Additive Outlier0.801690.30656.8410.0089
119Additive Outlier0.802610.30696.8410.0089
191Additive Outlier0.787330.30656.6010.0102


Last updated: November 24, 2025