At this stage, you can run the model via the Mosel command line or from Xpress Workbench. This guide follows a workflow that uses the facilities provided by the browser-based variant of Xpress Workbench and (later) its close integration with Xpress Insight.
Before trying to run anything, ensure that you have prepared two files:
- foliodata.mos - the model source file as described earlier.
- folio.dat - the separate data file containing values for the RET, RISK and NA entities, and implicitly the SHARES entity - again as described earlier.
To load and run the model within Xpress Workbench:
- Visit the Xpress Workbench URL and log in.
- In the Xpress Workbench Home page, click Create Project, enter a value of Portfolio Optimization in the Name field in the subsequent Create Project dialog and then click Save.
A new tile called
Portfolio Optimization appears in the Xpress Workbench
Home page.
|
Note Depending upon your installation, you may see an existing project tile labeled
Portfolio - an Optimization Model Example on the Xpress Workbench
Home page. This is a more advanced portfolio optimization model provided as an example, and is unrelated to the new
Portfolio Optimization project just created.
|
- Click on the Portfolio Optimization tile.
Xpress Workbench launches your new project in which it has created a template application structure. Examine the contents of the vertical Project tab:
A New Xpress Workbench Project
This arrangement of new files and folders is designed to help you start quickly with a new
Xpress Insight app.
- However, for this first walk-through, we are going to start from scratch, so right-click on the following resources, choose Delete, and confirm:
- client_resources - folder
- model_resources - folder
- source - folder
- application.xml - file
You are left with a single empty Portfolio Optimization root directory.
- In the File menu, choose Upload Local Files and follow the prompts to upload your prepared files - foliodata.mos and folio.dat - to the Portfolio Optimization root folder.
The project structure now appears as:
Uploaded Model Source and Data Files
- In the Run menu, choose Run foliodata.mos and wait a few moments.
The model compiles and runs, and a new file appears in the project tab, which now appears as:
Project Contents After First Model Run
The new file is
result.dat, the output file written by the model, originally declared as a parameter in line 8.
|
Note Depending on the settings of your Xpress Workbench environment, some other files may also appear at this stage. For the purposes of this tutorial, they can safely be ignored.
|
- Review the contents of result.dat.
It contains:
Total return: 14.0667
treasury : 30.000%
hardware : 0.000%
theater : 20.000%
telecom : 0.000%
brewery : 6.667%
highways : 30.000%
cars : 0.000%
bank : 0.000%
software : 13.333%
electronics : 0.000%
This reveals that the maximum achievable ROI is 14.0667, and that based on the model's constraints, the optimum division of investment capital among share types is 30% to treasury, 20% to theater, 6.667% to brewery, 30% to highways and 13.333% to software.
The model has been run in its native form as a Mosel model, albeit called and executed by Xpress Workbench.