Why a new language?

68
INFORMATION SYSTEMS AND PROCESSES XBRL FORMULAE TUTORIAL Víctor Morilla IT Project Manager of Bank of Spain Member of CEBS XBRL Network IX European Banking Supervisors XBRL Workshop Paris September 29th 2008 1

description

Why a new language?. Why not using existing languages like... JAVA, C#, C++ or Cobol XML based languages like XSLT, XQuery or Schematron Key requirements Easy and intuitive Maintainable Extensible. Why a new language?. Niklaus Wirth - PowerPoint PPT Presentation

Transcript of Why a new language?

Page 1: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

XBRL FORMULAE TUTORIAL

Víctor MorillaIT Project Manager of Bank of SpainMember of CEBS XBRL Network

IX European Banking Supervisors XBRL Workshop

Paris September 29th 2008

1

Page 2: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

WHY A NEW LANGUAGE?

Why not using existing languages like...-JAVA, C#, C++ or Cobol-XML based languages like XSLT, XQuery or Schematron

Key requirements–Easy and intuitive–Maintainable–Extensible

2

Page 3: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

WHY A NEW LANGUAGE?

Niklaus WirthDesigner of programming languages like Pascal, Euler or Modula

Author of the book “Algorithms + Data Structures = Programs”

3

Page 4: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

DATA STRUCTURES

4

Page 5: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

DATA STRUCTURES

5

1 2 3 4 78

79

80

81

5 6 7 8 9 10

11

12

...

evn : checks that a list of numbers has at least one 1, 2, ..., 9

evn(1,2,...,9) and evn(10,11,...,18) and evn(19,20,...,27) and ... evn(73,74,...,81)and evn(1,10,...,73) and evn(2,11,...,74) and ... evn(9,27,...,81)and evn(1,2,3,10,11,12,19,20,21) and ...

for i in (0...8) evn(1 + i*9, 2 + i*9, ..., 9 + i*9)for i in (0..8) evn(1 + i, 10 + i, ..., 73 + i)for i in (0..2) for j in (0..2) evn(1 + i + j*9, 2 + i + j*9, ...)

Page 6: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

DATA STRUCTURES

6

1 2 3 4 5 6 7 8 9

Row 2

Row 3

Row 4

Row 5

Row 6

Row 7

Row 8

Row 9

Row 1

Rowgroup 1

Rowgroup 2

Rowgroup 3

Columngroup 1

Columngroup 2

Columngroup 3

Page 7: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

DATA STRUCTURES

-For each row r: evn(r)-For each c: evn(c)-For each column group cg

and for each row group rg: evn(every cell in cg and rg)

7

Page 8: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

DATA STRUCTURE OF XSLT, XQUERY OR SCHEMATRON

8

Page 9: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

DATA STRUCTURE OF XBRL FORMULAE

9

Page 10: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

MULTIDIMENSIONAL VIEW OF XBRL FACTS: THE ASPECT MODEL

A value

A concept: Incomes

A set of dimensions

– Standard

• Entity

• Time

– User defined

• Titulizations

• Market

Additional properties: unit and precision

10

t

Credit institution

Concept

100 € (prec 3)

DexiaDec 2007

Incomes

Page 11: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

INPUT: VARIABLES AND FILTERS

To identify input data in a formula we use variables and filters:-Filters select slices and regions of our model:

-Concepts: Incomes, ...-Periods: 2008, 2007, ...-User dimensions: Country, ...

-Filters can be combined to select more specific data

11

A * B + C

Page 12: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

OUTPUT: XPATH EXPRESSIONS

($a + $b) * 2.5abs($x + $y) = $z

XPath 2.0: W3C Recommendation (since January 2007)Expression language used by XSLT, XQuery and SchematronWe can combine:

Arithmetic expressionsLogical expressionsConditional expressions…

Defines a set of standard operators and functions:+, -, *, div, mod, =, !=, <, >, and, or, …abs, ceiling, floor, concat, upper-case, …

12

Page 13: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

TYPES OF FORMULAE

Formulae to produce new facts from existing onesAssertions to verify a condition: true or false

Value assertionsExistence assertionsConsistency assertions

13

Page 14: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

EXAMPLES

MKR SA EQU MARKET RISK: STANDARDISED APPROACH FOR POSITION RISK IN EQUITIES

National market:  

        POSITIONS

RISK CAPITAL CHARGE

(%)

CAPITAL REQUIREMENTS

       

ALL POSITIONS

(-) REDUCTION EFFECT FOR

UNDERWRITING POSITIONS

NET POSITIONSNET POSITIONS

SUBJECT TO CAPITAL CHARGE

        LONG SHORT   LONG SHORT          (1) (2) (3) (4) (5) (6)   (7)

EQUITIES IN TRADING BOOK               

Link to CA template

1 General risk               8,00  

 1.1 Exchange traded stock-index futures broadly diversified subject to particular approach

               

  1.2 Other equities than exchange traded stock-index futures broadly diversified                

2 Specific risk                  

 2.1 High quality, liquid and diversified portfolios subject to lower capital requirements

            2,00  

  2.2 Other equities than high quality, liquid and diversified portfolios             4,00  

3 Particular approach for position risk in CIUs                

4 Margin-based approach for exchange-traded futures and options                

5 Margin-based approach for OTC futures and options                

6 Other non-delta risks for options                  

14

Page 15: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

EXAMPLE 1

15

Two input variables:$allPosShort:

Concept name: p-cm-mr:AllPositionsShort

$netPosShort:Concept name: p-cm-mr:NetPositionsShort

Test = “$allPosShort ge $netPosShort”

“All Positions Short“ greater or equal than “Net Positions Short”

Page 16: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

EXAMPLE 1: TECHNICAL REPRESENTATION

16

ValueAssertion@test = ““$allPosShort ge $netPosShort”

FactVariable

Concept Name:p-cm-mr:AllPositionsShort

FactVariable

Concept Name:p-cm-mr:NetPositionsShort

@name=“allPosShort” @name=“netPosShort”

Page 17: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

EXAMPLE 2

17

Two input variables:$allPosShort (fallbackValue = 0):

Concept name: p-cm-mr:AllPositionsShort

$netPosShort:Concept name: p-cm-mr:NetPositionsShort

Test = “$allPosShort ge $netPosShort”

“All Positions Short“ greater or equal than “Net Positions Short”Assume zero for “All Positions” if not reported

Page 18: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

EXAMPLE 2: TECHNICAL REPRESENTATION

18

ValueAssertion@test = ““$allPosShort ge $netPosShort”

FactVariable@fallbackValue=“0”

Concept Name:p-cm-mr:AllPositionsShort

FactVariable

Concept Name:p-cm-mr:NetPositionsShort

@name=“allPosShort” @name=“netPosShort”

Page 19: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

EXAMPLE 3

19

Two input variables:$allPosShort (fallbackValue = 0):

Concept name: p-cm-mr:AllPositionsShort

$netPosShort (fallbackValue = 0):Concept name: p-cm-mr:NetPositionsShort

Test = “$allPosShort ge $netPosShort”

“All Positions Short“ greater or equal than “Net Positions Short”Assume zero for “All and Net Positions” if not reported

Page 20: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

EXAMPLE 4A

20

Two input variables:$allPosShort :

Concept name: p-cm-mr:AllPositionsShortExplicit dimension: d-mr:MarketRiskDimension = d-mr:MRiskSAEQUTotal

$netPosShort :Concept name: p-cm-mr:NetPositionsShortExplicit dimension: d-mr:MarketRiskDimension = d-mr:MRiskSAEQUTotal

Test = “$allPosShort ge $netPosShort”

“All Positions Short“ greater or equal than “Net Positions Short”For Total Equities in Trading Book

Page 21: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

COMBINING FILTERS

Two or more filters produce the “intersection” of desired values(they are combined using an logical “AND”)

Boolean filters can be used for more complex combinations:- OR filter- AND filter

The attribute “complement” in arcs to filters can be used to obtain the negation of the filter linked (this attribute has been assumed to be “false” in examples).

21

Page 22: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

EXAMPLE 4B

22

A group filter:Explicit dimension: d-mr:MarketRiskDimension = d-mr:MRiskSAEQUTotal

Two input variables:$allPosShort :

Concept name: p-cm-mr:AllPositionsShort

$netPosShort :Concept name: p-cm-mr:NetPositionsShort

Test = “$allPosShort ge $netPosShort”

“All Positions Short“ greater or equal than “Net Positions Short”For Total Equities in Trading Book

Page 23: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

EXAMPLE 5A

23

A group filter:Explicit dimension: d-mr:MarketRiskDimension

d-mr:MRiskSAEQUGeneralRiskd-mr:MRiskSAEQUSpecificRisk

Two input variables:$allPosShort :

Concept name: p-cm-mr:AllPositionsShort

$netPosShort :Concept name: p-cm-mr:NetPositionsShort

Test = “$allPosShort ge $netPosShort”

“All Positions Short“ greater or equal than “Net Positions Short”For General risk and for Specific risk

Page 24: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

EXAMPLE 5B

24

Two input variables:$allPosShort :

Concept name: p-cm-mr:AllPositionsShortExplicit dimension: d-mr:MarketRiskDimension

d-mr:MRiskSAEQUGeneralRiskd-mr:MRiskSAEQUSpecificRisk

$netPosShort :Concept name: p-cm-mr:NetPositionsShortExplicit dimension: d-mr:MarketRiskDimension

d-mr:MRiskSAEQUGeneralRiskd-mr:MRiskSAEQUSpecificRisk

Test = “$allPosShort ge $netPosShort”

“All Positions Short“ greater or equal than “Net Positions Short”For General risk and for Specific risk

Page 25: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

EXAMPLE 6

25

Two input variables:$capReq :

Concept name: p-cm-mr:MarketRiskCapitalRequirementsExplicit dimension: d-mr:MarketRiskDimension = d-mr:MRiskSAEQUTotal

$netPosShort :Concept name: p-cm-mr:NetPositionsShort

Test = “$netPosShort lt $capReq ”

Any “Net Positions Short“ less than “Cap Requirements for equities in trading books”

Page 26: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

THE IMPLICIT FILTER

Three steps in the evaluation of a set of variables:Each variable is evaluated individually to obtain the list of all candidate values

$a = (a1, a2, a3)$b = (b1, b2)$c = (c1, c2)

The Cartesian product is obtained:

The implicit filter discards every combination that doesn’t verifies the following condition:

26

a1 a1 a1 a1 a2 a2 a2 a2 a3 a3 a3 a3

b1 b1 b2 b2 b1 b1 b2 b2 b1 b1 b2 b2

c1 c2 c1 c2 c1 c2 c1 c2 c1 c2 c1 c2

Page 27: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

THE IMPLICIT FILTER

27

For every pair of variables of a formula / assertion, the value of each aspect that is not explicitly filtered* by a variable filter must be the same

So, combinations that mix different values for aspects not explicitly filtered are not allowed

More precisely: aspects not covered. An aspect is covered for a variable if that variables has a variable filter for that aspect with the attribute @cover with a value of true. In this tutorial, it is assumed that every variable filter has this attribute set to true. Group filters don’t cover aspects. So, group filters are ignored by this rule

Page 28: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

EXAMPLE 7

28

$genRisk :Exp dimension: MarketRiskDimension = d-mr:MRiskSAEQUGeneralRisk

$exc (fallbackValue = 0) :Exp dimension: MarketRiskDimension = d-mr:MRiskSAEQUExchangeTradedStockIndexFuturesBroadlyDiversifiedSubjectParticularApproach

$other (fallbackValue = 0):Exp dimension: MarketRiskDimension = d-mr:MRiskSAEQUOtherEquitiesThanExchangeTradedStockIndexFuturesBroadlyDiversified

Test = “$genRisk = $exc + $other”

“General risk” (1) must be equal to the addition of 1.1 and 1.2For every concept

(zero assumed if missing)

Page 29: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

EXAMPLE 8

29

$total :Exp dimension: MarketRiskDimension = MRiskSAEQUTotal

$breakdown* (fallbackValue = 0):Exp dimension: MarketRiskDimension = d-mr:MRiskSAEQUGeneralRisk … d-mr:MRiskSAEQUOtherNonDeltaRisksOptions

Test = “$total = sum($breakdown)”

Total “Equities in trading book” equal to the sum of its breakdownFor every concept

(zero assumed if missing)

Page 30: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

XPATH DATA MODEL

Atomic values: a number, a string, ...1“Hello!”

Sequences(1, 5, 10)(“Foo”, “bar”)

Nodes

Some operators and functions apply to atomic values:2 + 5abs(-2)

Some operators / functions apply to sequences:sum((2, 3, 5))max((10, 20, 30))

30

Page 31: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

BIND AS SEQUENCE ATTRIBUTE

The attribute “bindAsSequence” in a variable is used to make the difference between:

- Variables to be bound to single values on each evaluation- Variables to be bound to sequences of values

31

Use sequence functions/operators with sequence variablesUse atomic/node functions/ operators with simple variables

Sequence variables are to be used with filters that select more than one value. Only aspects explicitly filtered* for these variables are mixed in one evaluation

*More precisely: only aspects covered

Page 32: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

EXAMPLE 8B

32

$total :Exp dimension: MarketRiskDimension = MRiskSAEQUTotal

$breakdown* (fallbackValue = 0):Exp dimension: MarketRiskDimension =

child of MRiskSAEQUTotal

Test = “$total = sum($breakdown)”

Total “Equities in trading book” equal to the sum of its breakdownFor every concept

(zero assumed if missing)

Page 33: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

AXIS IN EXPLICIT DIMENSION FILTERS

AXIS POSSIBLE VALUES:child:

France, Spain, Belgium

descentant:

France, Paris, Marseille, Lyon

Spain, ...

Belgium, ...

child-or-self:

Europe, France, Spain,

Belgium

descendant-or-self:

Europe

France, Paris, Marseille, Lyon

Spain, ...

Belgium, ...

33

World

Europe Asia ...

France Spain Belgium

Paris Marseille Lyon

The tree is selected choosing one extended link role and one arc roleThe tree is selected choosing one extended link role and one arc role

COREP and FINREP have hierarchies for every dimension in the default extended link role and domain-member arc role

COREP and FINREP have hierarchies for every dimension in the default extended link role and domain-member arc role

Page 34: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

EXAMPLE 9

34

test = “$total = sum($breakdown)”

Group filter:Concept name: p-cm-mr:AllPositionsLong

$total :Exp dimension: MarketRiskDimension = MRiskSAEQUTotal (axis=“child-or-self”)

$breakdown* (fallbackValue = 0):Exp dimension: MarketRiskDimension = child of $total

Total “Equities in trading book” equal to the sum of its breakdown, and “General Risk” equal to the sum of its

breakdown, and ...For “All Positions Long”

Page 35: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

DIMENSION FILTERS

Dimension:Using its name (@qname)Using an XPath expression that returns a name (@qnameExpression)

A list of members:Using its name (@qname)Using an XPath expression that returns a name (@qnameExpression)Using a reference to another variable (@variable)

+ (optional) an axis: Axis valueExtended link roleArc role

35

Page 36: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

EXAMPLE 10A

36

$capReq : Concept name: p-cm-ca:MarketRiskCapitalRequirements $netPosSub: Concept name: p-cm-mr:NetPositionsSubjectToCapitalCharge $allPositions*:

Concept name: p-cm-mr:AllPositionsLongp-cm-mr:AllPositionsShor t

test = “if (sum($allPositions) gt 100000) then $capReq = $netPosSub * 0.8 else true()”

“Capital requirements” equal to “Net positions subject to capital charge” multiplied by a factor only if “All

positions long” + “All positions short” is greater than a certain threshold

Page 37: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

EXAMPLE 10B

37

test = “$capReq = $netPosSub * 0.8”

$capReq : Concept name: p-cm-ca:MarketRiskCapitalRequirements $netPosSub: Concept name: p-cm-mr:NetPositionsSubjectToCapitalCharge $allPositions*:

Concept name: p-cm-mr:AllPositionsLongp-cm-mr:AllPositionsShor t

PRECONDITION: test = “sum($allPositions) gt 1000000”

“Capital requirements” equal to “Net positions subject to capital charge” multiplied by a factor only if “All

positions long” + “All positions short” is greater than a certain threshold

Page 38: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

PRECONDITIONS

Four steps in the evaluation of a set of variables:Each variable is evaluated individually to obtain the list of all candidate valuesThe Cartesian product is obtainedThe implicit filter discards combinationsOnly combinations that verifies every precondition are considered

38

A potential evaluation of an assertion that doesn’t verify a precondition is neither satisfied nor not satisfied:

it is not evaluated

Page 39: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

EXAMPLE 10C

39

test = “$capReq = $netPosSub * $factor”

$capReq : Concept name: p-cm-ca:MarketRiskCapitalRequirements $netPosSub: Concept name: p-cm-mr:NetPositionsSubjectToCapitalCharge $allPositions*:

Concept name: p-cm-mr:AllPositionsLongp-cm-mr:AllPositionsShor t

PRECONDITION: test = “sum($allPositions) gt $threshold”Parameters: $threshold = “1000000” $factor = “0.8”

“Capital requirements” equal to “Net positions subject to capital charge” multiplied by a factor only if “All

positions long” + “All positions short” is greater than a certain threshold

Page 40: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

PARAMETERS

Parameters variables that can be used inside XPath expressionsParameters can be given a default valueParameters can be given a value “from the outside”:

Using a graphical toolUsing an API...

They have a name so that they can be referred “from the outside”

40

Page 41: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

EXAMPLE 11A: BELGIUM ROUNDING APPROACH

41

test = “abs($total - sum($breakdown) ) le $threshold”

Group filter:Concept name: p-cm-mr:AllPositionsLong

$total :Exp dimension: MarketRiskDimension = MRiskSAEQUTotal (axis=“child-or-self”)

$breakdown* (fallbackValue = 0):Exp dimension: MarketRiskDimension = child of $total

Parameter $threshold = 1

Total “Equities in trading book” equal to the sum of its breakdown, and “General Risk” equal to the sum of its

breakdown, and ...For “All Positions Long” considering rounding error

Page 42: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

EXAMPLE 11B: SPANISH ROUNDING APPROACH

42

test = “abs($total - sum($breakdown) ) le $threshold”

Group filter:Concept name: p-cm-mr:AllPositionsLong

$total :Exp dimension: MarketRiskDimension = MRiskSAEQUTotal (axis=“child-or-self”)

$breakdown* (fallbackValue = 0):Exp dimension: MarketRiskDimension = child of $total

General variable: $threshold = “1000 * (count($breakdown) + 1) div 2”

Total “Equities in trading book” equal to the sum of its breakdown, and “General Risk” equal to the sum of its

breakdown, and ...For “All Positions Long” considering rounding error

Page 43: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

GENERAL VARIABLES

Its value is the result of evaluating an XPath expression

They can make reference to other variables/parameters in the assertion / formula

Can be used for intermediate values that are used repeatedly in the assertion / formla

43

Page 44: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

VARIABLES/PARAMETERS COMPARISON TABLE

Fact Variables Parameters General variables

Aim Bind facts in instance Parameterize the behaviour of some formula/assertions

Intermediate results derived from other variablesIterations in complex formulae

Use filters Yes No No

Implicit filter applies

Yes No No

Can be given values from outside the processor

No Yes May (using external functions)

Can have a fallback value

Yes No No

Can bind as sequence / single

Yes No Yes

Fixed value throughout the processing

No Yes No

References to other variables

Yes (through filters) No Yes 44

Page 45: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

TECHNICAL REPRESENTATION

45

ValueAssertion@test = ““$a ge $b * $c”

@aspectModel = “dimensional”@implicitFiltering = “true”

Fact Variable@fallbackValue=“0”

@bindAsSequence=“false”

Variable filter

@name=“a”

@name=“b”Parameter@bindAsSequence=“false”@name = “MyThreshold”

Group filter

@complement = “false”

@complement = “false”@cover = “true”

General Variable@select=“$a * $b”

@bindAsSequence=“false”

0..n

@name=“c”

0..n 0..n

0..n

0..n

Precondition@test=“...”

Precondition@test=“...”

0..n

Page 46: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

ATTRIBUTES GUIDANCE

Always use (no exceptions):@implicitFiltering = “true”@aspectModel = “dimensional”

Always use (except for very advanced formulae):@cover = “true”

Most of the times:@complement = “false”

That leaves:@name for variables and parameters arcs@bindAsSequence for fact variables and parameters@fallbackValue for fact variablesSpecific attributes of other objects:

@test in preconditions@name and select in parameters@select in general variables...

46

Page 47: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

EXAMPLE 12

47

test = “false()”

$capReq : Concept name: p-cm-ca:MarketRiskCapitalRequirements Exp dimension: MarketRiskDimension = MRiskSAEQUOtherNonDeltaRisksOptions

Check that “Capital Requirements” for “Other non-delta risks for options” is not reported

Page 48: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

EXAMPLE 13

48

test = “true()”

$capReq : Concept name: p-cm-ca:MarketRiskCapitalRequirements Exp dimension: MarketRiskDimension = MRiskSAEQUOtherNonDeltaRisksOptions

Check that “Capital Requirements” for “Other non-delta risks for options” must be reported

Page 49: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

EXAMPLE 14

49

Existence Assertion$capReq :

Concept name: p-cm-ca:MarketRiskCapitalRequirements Exp dimension: MarketRiskDimension = MRiskSAEQUOtherNonDeltaRisksOptions

Check that “Capital Requirements” for “Other non-delta risks for options” must be reported

Page 50: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

EXISTENCE ASSERTIONS

Value assertions are evaluated 0, 1 or n times, depending on the number of valid combinations for its variables given an input instance document

Existence assertions are always evaluated once.

An existence assertion is a test on the number of valid evaluations of its variable set

If the test attribute is not provided, it is tested that at least there is one valid evaluation of its variable set

The number of evaluations is referenced in the test expression by a dot

50

Page 51: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

EXAMPLE 15

51

Existence Assertion: test = “. ge 2”$capReq :

Concept name: p-cm-ca:MarketRiskCapitalRequirements Exp dimension: MarketRiskDimension = MRiskSAEQUOtherNonDeltaRisksOptions

Check that values for “Capital Requirements” for “Other non-delta risks for options” are reported for at least 2

national markets

Page 52: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

FORMULAE

The input of a formula is specified like the input of a value assertionBut additional information is needed to provide the output:

Value (ej: 100.000)Concept (ej: p-cm-ca:CapitalRequirements)Entity/scheme (ej: ES0182, MFI)Period (ej: January first 2008)User dimensions (ej: National Market = Spanish)For numeric values:

Units (ej: Euros)Decimals / precision attribute (ej: decimals = -3)

52

Page 53: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

FORMULAE

Value must always be explicitly definedDecimals/precision have a default value (precision 0)Aspects (concept, entity, period, user dimensions, units, ...) can be:

Explicitly definedDefined in terms of input facts (source)

53

Page 54: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

EXAMPLE 16: SIMPLE FORMULA

54

Input :$netPosSubCapCh:

Concept name: p-cm-mr:NetPositionsSubjectToCapitalCharge $decimals: Parameter

Output:value = “$netPosSubCapCh * 0.8”decimals = “$decimals”Source = “netPosSubCapCh”Concept name: p-cm-ca:MarketRiskCapitalRequirements

“Capital requirements” can be calculated as “Net positions subject to capital charge” multiplied by 0.8

Aspects not explicitly expressed in the output are “copied” from the source: - Unit - Period - Entity ...

Aspects not explicitly expressed in the output are “copied” from the source: - Unit - Period - Entity ...

Page 55: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

EXAMPLE 17: SIMPLE FORMULA WITH FALLBACK

55

Input :$shortNet (fallback value = 0):

Concept name: p-cm-mr:NetPositionsLong$longNet (fallback value = 0):

Concept name: p-cm-mr:NetPositionsShort

Output:value = “$shortNet + $longNet”decimals = “$decimals”Source = “$shortNet”Concept name p-cm-mr:NetPositionsSubjectToCapitalCharge

“Net positions subject to capital charge” calculated asthe addition of short and long net positions

(zero assumed if not reported)

If the source variable falls back, aspectscannot be obtained. The fallback value is a number !!!The processor will raise an error

If the source variable falls back, aspectscannot be obtained. The fallback value is a number !!!The processor will raise an error

Page 56: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

EXAMPLE 17B: SIMPLE FORMULA WITH FALLBACK

56

Input :$shortNet (fallback value = 0):

Concept name: p-cm-mr:NetPositionsLong$longNet (fallback value = 0):

Concept name: p-cm-mr:NetPositionsShort

Output:value = “$shortNet + $longNet”decimals = “$decimals”Source = “formula:uncovered”Concept name p-cm-mr:NetPositionsSubjectToCapitalCharge

“Net positions subject to capital charge” calculated asthe addition of short and long net positions

(zero assumed if not reported)

Page 57: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

SOURCE FORMULA:UNCOVERED

The “formula:uncovered” is a virtual variable which combines every aspect not explicitly filtered in the input)

Because of the implicit filter, every uncovered aspect must have the same value.

If an aspect is covered in every input variable, it must be explicitly defined

57

Page 58: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

EXAMPLE 18: SHOWING FORMULA:UNCOVERED

58

Input :$allLong (fallback value = 0):

Concept name: p-cm-mr:AllPositionsLong$reduction (fallback value = 0):

Concept name: p-cm-mr:ReductionEffectUnderwritingPositionsExp dimension: MarketRiskDimension = MRiskSAEQUTotal

Output:value = “$allLong + $reduction”decimals = “$decimals”Source = “formula:uncovered”Concept name p-cm-mr:NetPositionsLong

“Net positions long” calculated as “all positions long” plus “Reduction effect for total equities”

Page 59: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

EXAMPLE 19: MIXING UNITS

59

Input :$netPositionsSubhCapCh (fallback value = 0):

Concept name: p-cm-mr:NetPositionsSubjectToCapitalCharge $ratio (fallback value = 0):

Concept name: p-cm-mr:CapitalChargeRatio

Output:value = “$netPositionsSubhCapCh”decimals = “$decimals”Source = “formula:uncovered”Concept name p-cm-ca:MarketRiskCapitalRequirements

“Capital requirements” calculated as “net positions subject to capital charge” multiplied by

“risk capital charge”

Page 60: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

EXAMPLE 19B: MIXING UNITS

60

Input :$netPositionsSubhCapCh (fallback value = 0):

Concept name: p-cm-mr:NetPositionsSubjectToCapitalCharge $ratio (fallback value = 0):

Concept name: p-cm-mr:CapitalChargeRatioUnit filter: pure

Output:value = “$netPositionsSubhCapCh”decimals = “$decimals”Source = “formula:uncovered”Concept name p-cm-ca:MarketRiskCapitalRequirements

“Capital requirements” calculated as “net positions subject to capital charge” multiplied by

“risk capital charge”

Page 61: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

FORMULA GUIDELINE

• Define input variables• Try to use group filters• Use formula:uncovered as source• Give a explicit value to those aspects that are explicitly filtered on every input variable

61

Page 62: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

EXAMPLE 20

62

Input:$exc (fallbackValue = 0) :

Exp dimension: MarketRiskDimension = MRiskSAEQUExchangeTraded...Concept name p-cm-ca:MarketRiskCapitalRequirements

$other (fallbackValue = 0):Exp dimension: MarketRiskDimension = RiskSAEQUOtherEquitiesThan… Concept name p-cm-ca:MarketRiskCapitalRequirements

Output:Value: “$exc + $other”Source: “formula:uncovered”Exp dimension: MarketRiskDimension = d-mr:MRiskSAEQUGeneralRisk Concept name p-cm-ca:MarketRiskCapitalRequirements

“Capital requirement” for “General risk” calculated as“Capital requirements for exchange ...(1.1)” plus

“Capital requirements for other ...(1.2)”

Page 63: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

EXAMPLE 20

63

Input:Group filter: Concept name p-cm-ca:MarketRiskCapitalRequirements

$exc (fallbackValue = 0) :Exp dimension: MarketRiskDimension = MRiskSAEQUExchangeTraded...

$other (fallbackValue = 0):Exp dimension: MarketRiskDimension = RiskSAEQUOtherEquitiesThan…

Output:Value: “$exc + $other”Source: “formula:uncovered”Exp dimension: MarketRiskDimension = d-mr:MRiskSAEQUGeneralRisk

“Capital requirement” for “General risk” calculated as“Capital requirements for exchange ...(1.1)” plus

“Capital requirements for other ...(1.2)”

Page 64: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

CONSISTENCY ASSERTIONS

Value assertions can be used to check the quality of data at the supervisor:

A = B * C ( “=“ means “must be equal, if not, raise an error” )

Formulae can be used to derive data from basic information at the supervised institution:

A = B * C ( “=“ means “the left part is obtained from the right part” )

There is a lot in common between these two rules... Let’s take advantage

64

Page 65: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

CONSISTENCY ASSERTIONS

A consistency assertion is an assertion based on a formulaTest that the calculated results are consistent with the ones in the input instance document

Consistency assertion can include attributes to consider rounding errors:

Absolute acceptance radius: Defines an interval in absolute termsI.e: 1000

Relative acceptance radius: Defines an interval proportional to that of the inputI.e: 5%

This way, the same formula can be reused by the sender of the information to obtain the required data and by the receiver, to check it.

65

Page 66: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

A LOT OF FILTERS AVAILABLE

Concept aspect:By name By period-typeBy balance attributeBy custom-attributeBy data-type...

Dimensions:Explicit dimensionsTyped dimensions

General filters:ValuePrecision....

Unit:Single measureGeneral measure

Period:GeneralPeriod-startPeriod-end Period-instantForever filterInstant-duration

TupleEntitySegment / scenario...

66

Page 67: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

RESOURCES

Formula specification:http://www.xbrl.org/SpecCRs/

XPath specification:http://www.w3.org/TR/xpath20/

Xpath functions and operators:http://www.w3.org/TR/xquery-operators/

Herm Fischer’s Formulae Tutorial:http://herm.ws/XBRL/files/docs/FormulaTutorial.ppt

67

Page 68: Why a new language?

INFORMATION SYSTEMS AND PROCESSES

THANKS FOR YOUR ATTENTIONVÍCTOR MORILLA