Description Usage Arguments Details
This function prepares data stored in PostgreSQL or Oracle database for vintage analysis. According to Statsoft vintage analysis is: "Vintage Analysis. A vintage is a group of credit accounts that all originated within a specific time period, usually a year. Vintage analysis is used in credit scoring and refers to the process of monitoring groups of accounts and comparing performance across past groups. The comparisons take place at similar loan ages, allowing for the detection of deviation from past performance. Typically, a graphical representation is used for this purpose, such as one showing the relationship between months on the books and the percentage of delinquent accounts across multiple vintages." In this function concept of vintage is generalized in such way that any objects sharing same properties can form a vintage.
1 2 3 |
vintageUnitSql |
Valid SQL
| |||||||||||
performanceEventSql |
Valid SQL
Note: it does not make sense to include any other columns as these are not used by the function. Currently, only single column key is supported. | |||||||||||
timeGroup |
Aggregation of vintage data. Defines how distance between
| |||||||||||
timeExpansion |
Defines how time expansion is performed. By default,
vintages will be generated up to last existing point in events. E.g. when
maximum distance in data is 10 than every vintage will have 10
observations. There are three other options, using | |||||||||||
con |
Connection to PostgreSQL or Oracle database. This is an
connection object as produced by | |||||||||||
result |
Type of results to return. By default ( | |||||||||||
sqlModifier |
This will constraint result of | |||||||||||
distanceFunctionSchema |
Name of database schema where
| |||||||||||
verbose |
Prints additional diagnostics messages when | |||||||||||
debug |
Prints low level diagnostic messages. Usefull mainly for package
developer. Default is |
If successful, dataset with the following columns is returned:
Column | Description |
[Slicers] | As defined in
VintageUnitSQL . |
distance | Distance between vintage unit date and event date measured in time interval (currently month, quarter or year). |
vintage_unit_weight | sum of vintage unit weights for
given vintage at given distance. Note that one vintage can have different
values for different distances when no slicer is based on vintage unit date
and with granularity equal to time grouping of events (see examples to
understand this better). In case when no weight is defined that values are
equal to values in column vintage_unit_count . |
vintage_unit_count | number (of rows) for given vintage at distance. Using same logic as vintage unit weight. |
event_weight
| Sum of event weights for given vintage at distance. If no weight is defined, than 1 is used (equal to row count) |
event_weight_pct |
event_weight / vintage_unit_weight |
event_weight_csum | running total of event weights for given vintage ordered by distance. If no slicer is based on vintage date and with granularity equal to time grouping of events, than running total cannot be reproduced as running total of event_weight! See examples to understand this better. |
event_weight_csum_pct | event_weight_csum /
vintage_unit_weight |
rn | Column to numerically indicate order
of last Sclicer . Useful when last Slicer is time-orderable, but
data type is not number/date. |
This function is tested with PostgreSQL 9.1, but any version with window functions support should work.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.