Tip of the Week

Predictive Analytics with TIBCO Spotfire and S+ or R

Last week we discussed an important new concept in TIBCO Spotfire version 3.1, scenario analysis. This week we will continue learning about new 3.1 features by discussing another type of analytics: Predictive Analytics.

With TIBCO Spotfire version 3.1, you can communicate directly with S+ or R to execute scripts and functions. You can then return the data back into Spotfire as rows, columns, tables, and even values to properties, like Document Properties, Data Table Properties, and Column Properties.

For this example, we will be looking at interest rate differentials  (IRD) (http://www.investopedia.com/terms/i/interest-rate-differential.asp) for US and Canada from February 1976 to June 1996 and will try to calculate the IRD for future months.



 
The first thing we need to do is to create a S+ or R script that will take the data in and will predict the IRD out 5 months.
There are a variety of ways to do time series predictions: two of the common ones are Spline Analysis and the ARMA process (http://en.wikipedia.org/wiki/Time_series) For this tip we will use the ARMA process. If you would like additional information or training on other models, please consider taking our S+ or R training courses.

To execute the S+ or R script in Spotfire we have to create a Data Function. A  Data Function is basically a S+ or R Script or Function that is stored in the Spotfire Library to be used in Spotfire analysis files.

We create the Data Function by going to Tools > Register Data Functions and filling in the required information.  The first part is filling in the script itself:


 
Then we need to define the input parameters. These are the expected inputs going into the script. In this case, we are going to expect the script to receive a Data Table.
 

We then define the output via the output tab.  In this case, we are expecting the output to be a Data Table called result.

 

When you are done, you click the Save button to save the Data Function in the Spotfire Library.

Next, you need to add the Data Function into your document. To do this, you go to the Tools menu and click on the Data Functions tool and select the desired function.


 

Once you click OK, you can now define what to send into the Data Function as inputs and what to send the output of the Data Function to. These are called Input and Output Handlers.
The Input Handler will be both the date and Interest Ratio Differential columns from the Data Table.



 

The Output Handler will be a new Data Table called result.


 


Once we click OK, the calculation will occur and return a new Data Table called result, which includes the original date column, a value column for the Interest Rate Differentiator, and then a column called valueType which tells us if the row was an original row or a new, predicted row.


 
We can then create a line chart showing the date on the x-axis and the average value on the y-axis and color by Value Type, so you can see the predicted months at the end.



 
To take this example further, it is likely that a consumer may want to adjust how many months to predict. They may also want to adjust some variables in the algorithm. With TIBCO Spotfire 3.1, we can implement this by exposing variables like the length of prediction (in months) as properties where the consumer can pass in the value.


See the example below, where the consumer set the number of months to predict to 3 and the result Data Table and Line Chart get updated to show 3 month’s predictions.


 

If you would like more information on Data Functions and how to create them, please consider taking our 3.1 Delta Training Course SP1631  For more information on the specific algorithms and statistics we used, please consider taking our S+ or R training courses.

Comments

 

BeyeNETWORK: Report Reveals Organizations Empowering Employees … | Business Intelligence Wisdom said:

Pingback from  BeyeNETWORK: Report Reveals Organizations Empowering Employees … | Business Intelligence Wisdom

March 25, 2010 8:00 PM
 

Tip of the Week said:

We have shown in earlier posts how to execute Data Functions from within Spotfire using TIBCO Spotfire

October 24, 2010 8:57 PM
 

uggkensington said:

http://www.uggkensingtons.org/

http://www.uggkensingtons.org/ugg-fox-fur-short-boots-5531-c-54.html | UGG Fox Fur Short Boots 5531

http://www.uggkensingtons.org/ugg-kensington-boots-5678-c-2.html | UGG Kensington Boots 5678

http://www.uggkensingtons.org/ugg-rainier-eskimo-boots-5189-c-85.html | UGG Rainier Eskimo Boots 5189

http://www.uggkensingtons.org/ugg-retro-cargo-boots-1895-c-3.html | UGG Retro Cargo Boots 1895

December 27, 2011 8:13 PM
 

uggskensingtonsale said:

www.uggskensingtonsale.org

www.uggskensingtonsale.orgugg-adirondack-boots-ii-c-6.html | UGG Adirondack Boots II

www.uggskensingtonsale.orgugg-adirondack-tall-boots-c-11.html | UGG Adirondack Tall Boots

www.uggskensingtonsale.orgugg-amberlee-boots-c-34.html | UGG Amberlee Boots

www.uggskensingtonsale.orgugg-annabelle-boots-c-35.html |

December 28, 2011 4:16 AM
 

uggretrocargosale said:

January 4, 2012 8:50 PM

Leave a Comment

(required) 
(optional)
(required) 
Submit

Syndication

Tags

Other Spotfire Blogs

Spotfire's interactive information visualization and analytic solutions give users a remarkable experience for quickly and easily querying data and reporting results for superior business intelligence. From portfolio management and customer retention programs to key processes such as CRM, marketing, research, bioinformatics, yield and asset management and design for manufacturing, enterprises around the world rely on Spotfire's business analytics software to improve operational performance.

©Copyright 2000-2011 TIBCO Software Inc | Privacy Policy | Terms of Use I Blog I Contact Us I Content Center