Tweak PROC FASTCLUS for 1-Nearest Neighbor / Closest Match
In most table lookup tasks, we are doing EXACT matching. However, sometimes we are looking for closest match in the lookup table. By 'closest', we mean smallest Eucleadian distance: ||X-Y||2 Typically...
View ArticleFinding the Max Value In An Array
The max() function makes it easy to find the maximum value in a SAS array. Given an array like:array x[*] x1-x10;maxValue = max(of x[*]);Pretty slick, eh? Remember, it doesn't return the position of...
View ArticleImplementing Gap statistic for clustering number estimation
Gap statistic is a method used to estimate the most possible number of clusters in a partition clustering, noticeablly k-means clustering. This measurement was originated by Trevor Hastie, Robert...
View ArticleAn efficient macro for Stump – two terminal nodes tree
In this post, I post an improved SAS macro of the single partition split algorithm in Chapter 2 of "Pharmaceutical Statistics Using SAS: A Practical Guide" by Alex Dmitrienko, Christy Chuang-Stein,...
View ArticleData Steps 2010-07-19 22:25:00
I have a data set of sales data by day. Unfortunately the names of the columns represent the dates. In order to work with the data, I need to transform the data set so each day represents an...
View ArticleProc Fcmp(2): a subroutine for Binomial-CRR model
Problems: Quote for six-month American style euro currency options on plain vanilla, Max[S-K,0]and 〖Max[S-K,0]〗^0.5. Exchange rate S_0=$1.3721 /euroSix-month continuously compounded inter-bank rates:...
View ArticleProc Fcmp(4): Binomial tree vs. Black-Scholes model
The very truth is that SAS has limited financial functions. Thanks to SAS Institute, they finally added some option pricing functions in the base module of SAS 9.2, such as Black-Scholes put/call...
View ArticleArray 2.0: matrix-friendly array in Proc Fcmp
Array is probably the only number-indexed data type in SAS. SAS programmers adopt it mainly for multiple-variable batch-processing. For example, longitudinal summation can be achieved by specifying a...
View ArticleMap and Reduce in MapReduce: a SAS Illustration
In last post, I mentioned Hadoop, the open source implementation of Google’s MapReduce for parallelized processing of big data. In this long National Holiday, I read the original Google paper,...
View Article