Presentation is loading. Please wait.

Presentation is loading. Please wait.

Jian Chen1 Presented by Jian Chen PhD (Applied Statistics) MS (Computer Science) Sr. Statistician, Credigy Statistical computing with SAS/IML.

Similar presentations


Presentation on theme: "Jian Chen1 Presented by Jian Chen PhD (Applied Statistics) MS (Computer Science) Sr. Statistician, Credigy Statistical computing with SAS/IML."— Presentation transcript:

1 Jian Chen1 Presented by Jian Chen PhD (Applied Statistics) MS (Computer Science) Sr. Statistician, Credigy Statistical computing with SAS/IML

2 Jian Chen2 SAS/IML SAS Interactive Matrix Language: Beyond!

3 Jian Chen3 Outline Overview of SAS/IML. Language nuts and bolts. An example in Bayesian Analysis. Applications. References.

4 Jian Chen4 Features of SAS/IML The simple SAS/IML program: Proc iml; Print ‘Hello World!’; Quit; Is a programming language operating on matrices. Has a complete set of control statements. Has a powerful vocabulary of operators. Can use operators that apply to entire matrices. Can be interactive.

5 Jian Chen5 Features of SAS/IML (2-2) Many Base SAS functions are accessible from SAS/IML and has many built-in functions. Can define function or subroutine and write the core algorithm. Can call a C program (or Fortran, Cobol, PL/I programs) within SAS/IML via the module() functions (Windows only).

6 Jian Chen6 With SAS/IML Edit existing SAS data sets or create new ones. Access external files with an extensive set of data processing commands for data input and output.

7 Jian Chen7 Numerical Functions and Algorithms Subroutines: –Outlier detection and robust regression. –Performs numerical integration of scalar functions in one dimension over infinite, connected semi-infinite, and connected finite intervals –Optimization: for minimizing or maximizing a continuous nonlinear function f = f(x) of n parameters. Produce graphics with a powerful set of graphics commands (Need SAS/Graph). Kalman Filters. Time Series Analysis. Wavelet Analysis. Genetic Algorithms – Experimental. Sparse Matrices – Experimental.

8 Jian Chen8 An example –Problem: Assume we know Y(1),…,Y(n), what are the future values: Y(n+1), Y(n+2), ……? –The p-th autoregressive model: AR(p) where

9 Jian Chen9 Priors Bayes Approach: Under the Normal-Gamma prior where

10 Jian Chen10 Loss Function Modified Higgins-Tsokos loss function where and C 1, C 2 make the loss function continuous, that is:

11 Jian Chen11 Loss Function

12 Jian Chen12 Loss Function

13 Jian Chen13 The k-step Bayes prediction The Bayesian predictive density of W k (k-step ahead Bayes forecasting) is where W k =(Y(n+1),Y(n+2),…,Y(n+k) ) and S n =(Y(1),…,Y(n));

14 Jian Chen14 The k-step Bayes prediction –where –Others are the parameters in prior or matrix from n observations.

15 Jian Chen15 Example For Hölfer sunspot data, the shape of the joint pdf of future two-step ahead forecasting is graphed using (14.1)Hölfer

16 Jian Chen16 Practical k-step ahead forecasting Get the one-step ahead forecasting. Apply one-step ahead forecasting method again with (Y(1), Y(2), …, Y(n), ) to get. ……

17 Jian Chen17 K-th step ahead forecasting The pdf of one-step ahead forecasting is:

18 Jian Chen18 K-th step ahead forecasting where t-distribution is defined as

19 Jian Chen19 Bayes estimate under MHT loss Bayes expected loss:

20 Jian Chen20 Bayes estimate under MHT loss –Bayes estimate (Bayes action) under MHT loss function.

21 Jian Chen21 Simulation and Calculation with SAS –Based on the assumption on priors, simulate the parameters in model (7.1). –Generate AR(p) series. –Calculate the one-step ahead Bayes estimate under MHT loss function. –Calculate the two-step ahead Bayes estimate under MHT loss function.

22 Jian Chen22 Simulation and Calculation with SAS SAS techniques used: –Simulation –Time Series (model identification and calculation). –SAS/IML: Import from/export to SAS dataset. Interface with other SAS PROCs. Matrix calculation. Integration. Optimization.

23 Jian Chen23 Integration CALL QUAD ( result, "fun", points ) ; CALL QUAD ( r, "fun", points) ; The QUAD subroutine quad is a numerical integrator based on adaptive Romberg-type integration techniques. Refer to Rice (1973), Sikorsky (1982), Sikorsky and Stenger (1984), and Stenger (1973a, 1973b, 1978).

24 Jian Chen24 Optimization Optimization: The IML procedure offers a set of optimization subroutines for minimizing or maximizing a continuous nonlinear function f = f(x) of n parameters, where x = (x 1,...,x n )’: –NLPCG Conjugate Gradient Method –NLPDD Double Dogleg Method –NLPNMS Nelder-Mead Simplex Method –NLPNRA Newton-Raphson Method –NLPNRR Newton-Raphson Ridge Method –NLPQN (Dual) Quasi-Newton Method –NLPQUA Quadratic Optimization Method –NLPTR Trust-Region Method

25 Jian Chen25 Applications “Computing Group Sequential Boundaries Using the Lan-DeMets Method with SAS”. Sample size and power analysis. SAS for Monte Carlo Studies: A Guide for Quantitative Researchers: By Xitao Fan, Akos Felsovalyi, Stephen A. Sivo, and Sean C. Keenan: http://support.sas.com/publishing/bbu/companion_site/57 323.html http://support.sas.com/publishing/bbu/companion_site/57 323.html A collection of SAS macro programs using SAS/IML software to generate, randomize and inspect orthogonal arrays for computer experiments and integration. http://sunsite.univie.ac.at/statlib/designs/oa.SAS

26 Jian Chen26 References Jian Chen, Bayes Inferences and forecasting of Time Series, PhD thesis, UNC Charlotte. SAS Online Documentation for SAS/IML: http://support.sas.com/onlinedoc/ 913 /docMai npage.jsp http://support.sas.com/onlinedoc/ 913 /docMai npage.jsp Sample programs installed with your installation: Located in directory: C:\Program Files\SAS\ SAS 9.1 \iml\sample

27 Jian Chen27


Download ppt "Jian Chen1 Presented by Jian Chen PhD (Applied Statistics) MS (Computer Science) Sr. Statistician, Credigy Statistical computing with SAS/IML."

Similar presentations


Ads by Google