# Example Model with absolute market data and correlation

Learn how to build a model with a rollforward logic that adjusts the market growth with a correlation factor.

Goal & Solution

Variable Costs should be automatically calculated for the future, based on a correlation factor with the market, which is modelled as absolute values. Hence, we derive the market growth, have the correlation factor influence the growth, and then use that weighted market growth to "Rollforward" the cost base.

## Input Data

• Market data for all years (Created in-place via EXPANDSINGLE in the example)
• Var. Cost Base - Base Data for the first year of the simulation

## Calculations

Node Formula Explanation / Notes
Growth

• SHIFT with "-1" gets the previous year
• ADDEACH "-1" subtract -1 (=100%) from each year.
• Hint: ('Market'  - SHIFT('Market',"Year",-1) ) / SHIFT('Market',"Year",-1) leads to the same result
Weighted Market Growth 'Correlation with Market' * 'Growth'

This node can also be left out and the formula used directly in the "Var Cost" node.

Correlation with Market EXPAND(1,"Year") Use a default 1 for 1 correlation. This node can be changed in the simulation
Var Cost ROLLFORWARD('Var. Cost Base','Weighted Market Growth') Use the Rollforward logic to forecast values for the simulation years.

This model uses the following functions:

• ROLLFORWARD
• SHIFT
• EXPAND & EXPANDSINGLE

The example model does not need an external datasource. The complete model code:

```model("Correlation Model") {
horizon "Year", "2017", "2020"
defaultDigits 5
defaultScale "s"
defaultUnit "Scalar"

baseline "Default Scenario"

node("Correlation with Market") {
operation """EXPAND(1,"Year")"""
simulationType "SIM"
expectedLevels "Year"
aggregationType "SUM"
}

node("Growth") {
unit "Percent"
expectedLevels "Year"
aggregationType "SUM"
}

node("Market") {
operation """EXPANDSINGLE(100,"Year", "2017") +EXPANDSINGLE(105,"Year", "2018")+EXPANDSINGLE(107,"Year", "2019")+EXPANDSINGLE(110,"Year", "2020")"""
expectedLevels "Year"
aggregationType "SUM"
}

node("Var Cost") {
operation "ROLLFORWARD('Var. Cost Base','Weighted Market Growth')"
expectedLevels "Year"
aggregationType "SUM"
}

node("Var. Cost Base") {
operation """EXPANDSINGLE(1000,"Year","2017")"""
expectedLevels "Year"
aggregationType "SUM"
}

node("Weighted Market Growth") {
operation "'Correlation with Market' * 'Growth'"
unit "Percent"
expectedLevels "Year"
aggregationType "SUM"
}

}```