Asymmetrical Copula Example
In this example, an asymmetrical t copula is used to correlate two uniform distributions. The asymmetrical parameter is varied over a range of values to demonstrate its effect. The resulting graphs is produced by using ODS graphics.
data histdata;
do asym = -1.3 to 1.1 by .3;
date='01aug2007'd;
y = .5;
z = .5;
output;
end;
run ;
/* Add the asymmetric parameter to cov mat */
data asym;
do asym = -1.3 to 1.1 by .3;
y = asym;
z = 0;
_name_ = " ";
_type_ = "asym";
output;
y = 1;
z = .65;
_name_ = "y";
_type_ = "cov";
output;
y = .65;
z = 1;
_name_ = "z";
_type_ = "cov";
output;
end;
run;
proc model out=sim(where=(_REP_ > 0)) data=histdata sdata=asym;
y = 0;
errormodel y ~ Uniform(0,1);
z = 0;
errormodel z ~ Uniform(0,1);
solve y z / random=500 seed=12345 copula=(t(5) asym );
by asym;
run;
To produce a panel plot of this joint distribution, use the following SAS/GRAPH statements.
ods graphics on / height=800 width=800;
proc template;
define statgraph myplot.panel;
BeginGraph;
entrytitle halign=left halign=center
textattrs=GRAPHTITLETEXT "t Copula with a Range of Asymmetry";
layout datapanel classvars=(asym) / rows=3 columns=3
order=rowmajor height=1024 width=1420
rowaxisopts=(griddisplay=on label=' ')
columnaxisopts=(griddisplay=on label=' ');
layout prototype;
scatterplot x=z y=y ;
endlayout;
endlayout;
EndGraph;
end;
run;
proc sgrender data=sim template='myplot.panel';
run;
|