The HPQLIM Procedure

Example 8.2 Bayesian High-Performance Model with Censoring

This example shows the use of the Bayesian analysis available in the HPQLIM procedure with an emphasis on processing a large data set and on the performance improvements that are achieved by executing in a high-performance distributed environment.

The model and the data set are the same as in Example 8.1, and the priors are set to the defaults.

The model is executed in the distributed computing environment with two threads and only one node. These settings are used to obtain a hypothetical environment that might resemble running the HPQLIM procedure on a desktop workstation with a dual-core CPU. To run the following statements successfully, you need to set the macro variables GRIDHOST and GRIDINSTALLLOC to resolve to appropriate values, or you can replace the references to the macro variables in the example with the appropriate values.

    option set=GRIDHOST="&GRIDHOST";
    option set=GRIDINSTALLLOC="&GRIDINSTALLLOC";
 proc hpqlim data=simulate ;
 bayes nbi=10000 nmc=30000;
    performance nthreads=2 nodes=1 details
                 host="&GRIDHOST" install="&GRIDINSTALLLOC";
    model y=x1-x7 /censored(lb=0 ub=400);
    %*;     ods output PerformanceInfo=perfInfo;
    %*;     ods output Timing=time;
run;

Output 8.2.1 shows a summary of the posterior distribution that is associated with the censored model when you use diffuse prior distributions.

Output 8.2.1: Posterior Summary for Bayesian Censored Model

Estimating a Tobit model

The HPQLIM Procedure

Posterior Summaries
Parameter N Mean Standard
Deviation
Percentiles
25% 50% 75%
Intercept 30000 2.2192 0.2160 2.0730 2.2171 2.3597
x1 30000 3.0564 0.1954 2.9246 3.0571 3.1890
x2 30000 3.9980 0.1980 3.8660 3.9954 4.1295
x3 30000 1.8540 0.1952 1.7238 1.8508 1.9844
x4 30000 4.1725 0.1986 4.0399 4.1717 4.3040
x5 30000 -3.0089 0.1988 -3.1414 -3.0090 -2.8818
x6 30000 -5.1681 0.1971 -5.3011 -5.1671 -5.0341
x7 30000 -2.6998 0.1955 -2.8312 -2.7000 -2.5656
_Sigma 30000 400.0 0.2548 399.8 400.0 400.2



Output 8.2.2 show a summary of the performance when you use a distributed computing environment with one node and two threads.

Output 8.2.2: Performance Analysis for Bayesian Censored Model on One Node with Two Threads

Estimating a Tobit model

Performance Information
Host Node << your grid host >>
Install Location << your grid install location >>
Execution Mode Distributed
Number of Compute Nodes 1
Number of Threads per Node 2

Estimating a Tobit model

Procedure Task Timing
Task Seconds Percent
Reading and Levelizing Data 1.59 0.00%
Communication to Client 0.06 0.00%
Bayesian Analysis: Likelihood for MCMC 38698.65 99.84%
Bayesian Analysis: MCMC 0.63 0.00%
Optimization 58.54 0.15%
Post-optimization 0.00 0.00%



Finally, Output 8.2.3 shows the diagnostic and summary plots that are associated with X1.

Output 8.2.3: Bayesian Diagnostic and Summary Plots for x1

Bayesian Diagnostic and Summary Plots for x1


In the following statements, the PERFORMANCE statement is modified to use a grid with 10 nodes, where each node spawns eight threads:

    option set=GRIDHOST="&GRIDHOST";
    option set=GRIDINSTALLLOC="&GRIDINSTALLLOC";
 proc hpqlim data=simulate ;
 bayes nbi=10000 nmc=30000;
    performance nthreads=8 nodes=10 details
                 host="&GRIDHOST" install="&GRIDINSTALLLOC";
    model y=x1-x7 /censored(lb=0 ub=400);
    %*;     ods output PerformanceInfo=perfInfo;
    %*;     ods output Timing=time;
run;

The two models are identical, but the second implementation, which was run on a grid that used 10 nodes with eight threads each, took only 24 minutes instead of 10.75 hours to sample from the same posterior distribution.

Output 8.2.4: Performance Analysis for Bayesian Censored Model on Ten Nodes with Eight Threads Each

Estimating a Tobit model

Performance Information
Host Node << your grid host >>
Install Location << your grid install location >>
Execution Mode Distributed
Number of Compute Nodes 10
Number of Threads per Node 8

Estimating a Tobit model

Procedure Task Timing
Task Seconds Percent
Reading and Levelizing Data 0.08 0.01%
Communication to Client 0.23 0.02%
Bayesian Analysis: Likelihood for MCMC 1432.69 99.83%
Bayesian Analysis: MCMC 0.17 0.01%
Optimization 1.90 0.13%
Post-optimization 0.00 0.00%