A scorecard for probability of default with sparkline In the 1st chapter of their must-read credit risk modeling book, Gunter and Peter used the ratios of working capital(WC), retained earnings(RE), earnings before interest and taxes(EBIT), sales(S) and market value of equity(ME) over either total liabilities (TL) or total assets(TA), to build a logit default risk model for 4000 records by 791 firms through 10 years [Ref.1]. The authors implemented VBA’s user-defined functions in Excel to realize the modeling and scoring procedures. In SAS, Proc Logistic does the same job. Macros in SAS and Excel can be used together. Excel2010’ new Sparkline functions visualize the fluctuations of values in ...
Monte Carlo and quasi-Monte Carlo simulations for credit risk In SAS, we can do quasi-Monte Carlo simulation by Halton’s low-discrepancy sequences, which are better than random variables from uniform distribution . The only procedure in SAS 9.2 to produce Halton’s sequence is probably the MDC procedure in SAS/ETS [Ref. 2] but hard to output. However, we can build a user-defined function by PROC FCMP to realize our goals. I showed an example by modifying the codes from Paolo Brandimarte’s Matlab book [Ref. 1] to estimate the area of an arbitrary surface. Overall, Halton’s method would converge with more sampling points, while uniform randomization will cause estimates fluctuating along the ...
A macro design pattern by PROC FCMP We all heard horrible stories that someone tried to piece together a bunch of nice functioning macros for a big macro, and ended up with a messy and undebuggable system. Part of reasons can be about encapsulation: not all SAS programmers have the good habit to localize the macro variables by %local statement; the leaking macro variables may ruin the attempt to utilize multiple macros written by different SAS programmers. To solve this problem, Mark Tabladillo brought the concepts of encapsulation, polymorphism, and inheritance into nested macros. And he raised several design patterns for macros to emulate the object-oriented languages.The ...
Top 10 reasons for a modeler to learn PROC FCMP 10.  New financial functions34 pre-compiled financial functions were shipped with SAS for free, which can be called in DATA step.9. A management GUIThere is a nice-looking Java-powered GUI to manage the user-defined functions: SAS FCmp function editor.8. Dynamic parametersParameters from other statistical procedures in SAS can be passed to a function. We can use a macro to wrap PROC FCMP to create tons of data-driven functions (temporary or permanent).7. Migration from VBAExcel dominates every desktop. However, using VBA to process large data is just a pain, such as calculating a transition matrix for probability of default. PROC FCMP is built ...
Why sometimes use DATA Step instead of PROC SQL A questionThere is an interesting thread about the efficiency of PROC SQL on Mitbbs.com.Both datasets have1 and have2 have few variables, but many observations. Very simple program, but without any result after running it for a whole afternoon.proc sql; create table want as select * from have1 as a left have2 as b on b.serie_beg <= a.serie <= b.serie_end;quit;If I replace left join with inner join, the result is the same. Why it takes so long?Four types of joins in PROC SQLTo understand this question, we may have to go back into PROC SQL. A technical paper introduces that like ...