Introduction

The purpose of the Scalar analysis is to do calculations across some time series at specific points or ranges in time and produce category series.

As an example, assume that we have three time series called S1, S2 and S3. We want to look at the values in 1994 and 1999. This can be done by specifying two “Value at” calculations in the Scalar analysis:

scalar1

With the setting “One series per calculation,” this will take the values for 1994 and 1999 and produce two category series:

scalar2

The order of the series in the Input series section defines the order of the values in the produced category series. You can adjust the order by dragging the handle to the left of the list or sort them alphabetically by pressing the Sort button.

These category series can then be used in a number of ways such as in charts, tables and exporting to Excel. For example, here is a Category table, Bar chart, Category chart and Category scatter chart:

scalar3 scalar4
scalar5 scalar6

Groups

Sometimes you do not want just one series for each calculation across all input series. The input series might, for instance, describe two aspects of something. In that case you probably want to divide the series into groups in the Scalar analysis. This can be done in two ways:

Which way you select depends on what is the most convenient order of the series.

Here is an example where the setting “New group after every 3 series” has been used. You can see which group each series will belong to by looking at the number of the Group column in the Input series table.

scalar7

This will produce four series like this:

scalar8

By using the same input data, but selecting “Partition into 2 series” instead, like this:

scalar9

There will be four series:

scalar10_2

There is a good example in the chart library of how groups can be used: Macrobond chart library : Examples/Comparing values/Scatter chart comparing two parameters for a number of countries

One series per input

With the “One series per input” option, there will be one category series per each input series and the values in each series will correspond to the specified list of calculations.

This can, for example, be useful when you want to compare a number of series at some points in time. With settings like this:

scalar11

There will be three category series calculated as follows:

scalar12

Here is what the result looks like in a column chart:

scalar13

Calculations

Included time series

You can select what time series to include in the calculations. All series are included by default, but you can un-check series in the the "Include" column.

New series will be included automatically unless you un-check "Include new series automatically". This setting was added in version 1.18.

Points in time and ranges

For many calculations you can specify a point in time or a time range.

If a relative point in time is specified, this will refer to the end of the calendar, which is based on the range of valid values of all input series. If no point in time is specified, the time of the last valid value will be used. If you want to reference the last point of the calendar, you can use a relative reference like “+0”.

When a range is specified, relative points in time are also relative to the end of the calendar, but there is one exception: when only a relative starting point is specified and no end point, the end point will be the last valid value and the starting point will be relative to that point in time instead of the end of the calendar. If you still want to reference the calendar for your starting point in that case, you can use an end point like “+0”.

Measures of change

Many of the calculation methods offer the option to calculate a rate of change as Value, Percentage or Logarithmic. These calculations are done in this way:

value = y t - y t - n
percentage = 100 y t - y t - n | y t - n |
logarithmic = 100 ln y t y t - n
annualRateValue = c h i = 1 h z t + 1 - i
annualRatePercent = 100 z t z t - h c h - 1

where c is the typical number of observations during one year.

Calculation methods

Open, High, Low, Close

The first, highest, lowest or last value of the specified range.

Mean, Median, Standard deviation

The mean, median or standard deviation value of the range.

Last

The last valid value of the series.

Last common

The value of the last point where there is a value in all of the series used in the calculation.

This method is available in version 1.18 and later.

Value at

The value at a specific point in time. If a date that does not exist in the calendar, the first valid previous date will be used.

Percentile

The specified percentile of the range.

Lower, Upper tail mean

The mean of the values in the upper or lower percentile as specified by the percentage.

Year, Quarter, Month, Week to date

Performance from the start of the period to the specified date. The performance is measured as the change compared to the last value of the previous period.
You can select to express the performance as the change in value, percentage change or logarithmic change.

Performance since

Performance from a specified date to another date. The performance is measured as the change compared to the last value of the previous period.

You can select to express the performance as the change in value, percentage change or logarithmic change.

Years, Quarters, Months, Weeks back

The change from a number of periods back to the specified date.

You can select to express the change as the change in value, percentage change or logarithmic change.

For years and quarters, this is the same as using the “Rate of change since” method and specifying the start of the range as “-1y” or “-1q”.

Rate of change since

The rate of change between two points in time.

You can select to express the change as the change in value, percentage change or logarithmic change.

Percentage proportion

The proportion, as a percentage, of each series compared to the sum at a specified point in time.

Examples in the Macrobond chart library

You can find some examples where the Scalar analysis is used in the Macrobond chart library: