标题: Cholesky decomposition to "expand" data [打印本页] 作者: shiyiming 时间: 2012-2-10 03:10 标题: Cholesky decomposition to "expand" data From Dapangmao's blog on sas-analysis
<div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/-eTlJ_pT7DLw/TzQQ-Y7AgnI/AAAAAAAAA60/1UNsfqM7IsI/s1600/plot1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="http://2.bp.blogspot.com/-eTlJ_pT7DLw/TzQQ-Y7AgnI/AAAAAAAAA60/1UNsfqM7IsI/s320/plot1.png" width="320" /></a></div><br />
Yesterday Rick showed how to use <a href="http://blogs.sas.com/content/iml/2012/02/08/use-the-cholesky-transformation-to-correlate-and-uncorrelate-variables/">Cholesky decomposition to transform data</a> by the ROOT function of SAS/IML. Cholesky decomposition is so important in simulation. For those DATA step programmers who are not very familiar with SAS/IML, PROC FCMP in SAS may be another option, since it has an equivalent routine CALL CHOL.<br />
<br />
To replicate Rick’s example of general Cholesky transformation correlates variables, I chose three variables from a SASHELP dataset SASHELP.CARS and created a simulated dataset which shares the identical variance-covariance structure. A simulated dataset can be viewed as an “expanded’ version of the original data set.<br />
<br />
Conclusion:<br />
In PROC FCMP, don’t allocate many matrices. A better way is to use CALL DYNAMIC_ARRAY routine to resize a used matrix. It is similar to Redim Statement in VBA. A VBA programmer can easily migrate to SAS through PROC FCMP.<br />
<br />
<br />
<pre style="background-color: #ebebeb; border: 1px dashed rgb(153, 153, 153); color: #000001; font-size: 14px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"><code>
proc corr data=sashelp.cars cov outp=corr_cov plots=scatter;
var weight length mpg_city;
run;