Developing Time-Series Forecasting Code

For development with the Predictor Developer Kit, you can use any development environment that supports the use of Microsoft COM components. Such an environment lets you use VB6, VBA (supplied with Microsoft Word and Microsoft Excel), C++, ASP, and similar COM-compatible languages (you will still need the Microsoft .NET Framework). To access the Predictor Developer Kit, you must reference the COM object named CBCOMDevKit, which is registered on your computer during the installation.

In addition to this book, the Predictor Developer Kit contains two other files with information about kit contents and how to use it, CB Com Devkit.chm and Toledo Gas.xls. CB Com Devkit.chm is a reference help file with lists and descriptions of methods and properties in Predictor Developer Kit classes. It also contains information on the OptQuest Developer Kit, available with Oracle Crystal Ball Decision Optimizer, Fusion Edition.

For more information about CB Com Devkit.chm, see CB Com Devkit.chm. Although the information there refers to the OptQuest Developer Kit, the information is basically the same for the Predictor Developer Kit. Be aware that class names are different, as described in Important Predictor Classes.

Toledo Gas.xls is a Crystal Ball example file used as a tutorial example in the Oracle Crystal Ball Predictor User's Guide. It contains annotated code that performs similar tasks to those described in the Predictor User's Guide.

  To view the Predictor Developer Kit sample code:

  1. Open Toledo Gas.xls.

    From the Window task bar, you can select Start, then All Programs, then Oracle Crystal Ball, then Examples, and then View Examples Guide. From the list of examples, select Toledo Gas.

  2. With the example model open, open the Microsoft Excel Visual Basic Editor.

  3. In the Editor, select Tools, and then References. Confirm that CBCOMDevKit is selected in the list.

  4. In the Project Explorer, select Module1 for Toledo Gas.xls.

  5. Study the code annotations for examples of how to perform basic Predictor operations.

    Notice that code illustrating the event feature and ARIMA time-series forecasting is included.

As you study the code annotations, refer to basic code strategies outlined in Coding an Optimization. Although this information refers to the OptQuest Developer Kit, basic rules and guidelines apply to the Predictor Developer Kit.

Note:

Although coding is similar in the OptQuest and Predictor Developer Kits, ignore the sections on user-defined event macros and events in VBA. The Predictor Developer Kit does not support user-defined events.