Skip to content

SDMX Connector for MATLAB

Attilio Mattiocco edited this page Aug 21, 2015 · 23 revisions

MatSDMX is the MATLAB Connector for SDMX.

All the instructions that follow refer to linux, but they can be easily adapted to Windows installations.


How to build it

The only part of the connector that needs to be built is the Java library. Instructions can be found in the java section

NOTE: building the java library is not strictly necessary. A jar file, ready to be used, can be found in the release lib subdirectory


How to install it

  1. Download the latest stable release from the downloads section of the releases page and unpack it. Get the m-files from the MATLAB directory.

  2. Add the m-files to the MATLAB search path. This task can be accomplished in different ways. You can refer to the MATLAB online help for the most suitable way.

  3. Add the Java library (SDMX.jar) to the MATLAB static classpath. The steps are described in the MATLAB online help

NOTE: Adding the Java library to the dynamic classpath does not always work, due to classloading problems.

  1. If necessary, override the default configuration by means of a custom configuration file. This is particularly necessary if you want to run the connector in an environment that connects to the internet by means of a proxy.

How to use it

Help pages can be obtained in the usual way:

doc MatSDMX

Get the list of available data providers:

getProviders

Get the list of available data flows for data provider ECB:

flows=getFlows('ECB')

If we want to refine the search with a search pattern:

exr=getFlows('ECB', '*Exchange*')

Get the list of dimensions for data flow EXR:

dims=getDimensions('ECB', 'EXR')

As an alternative, we can explore all the metadata of interest with the graphical SDMX helper:

sdmxHelp

Finally, let's get some data (I guess this is what you really want...)

single time series, freq=A, CURRENCY=USD
result = getTimeSeries('ECB', 'EXR.A.USD.EUR.SP00.A')

multiple time series, FREQUENCY=A (annual), all currencies
result = getTimeSeries('ECB', 'EXR.A.*.EUR.SP00.A')

multiple time series, all currencies, freq = A or M (monthly)
result = getTimeSeries('ECB', 'EXR.M+A.*.EUR.SP00.A')

NOTE: data calls will return a cell array of timeseries classes. The time series metadata is stored in the UserData slot (the dimensions) and in the DataInfo.UserData slot (the attributes)

If you prefer to work with a MATLAB table you can use the sdmxtable function to convert the series list. This is supported only in MATLAB 2013B and higher versions (when the tables were introduced).

tstable = sdmxtable(result , true)