BookmarkSubscribeRSS Feed
Max05
Obsidian | Level 7

Dear all, 

I am doing 1000 bootstrap simulations delivering 1000 series of returns. 
Afterwards I need to plot these series on one a cumulative distribution function graph but I need to aggregate these 1000 series in only one cumulative distribution (the mean of all the simulations) and then compare it with the cumulative distribution of the actual series of returns.

 

Do you have any idea for me? Knowing that I have a first column with the actual returns and then 1000 columns with the series of return from the 1000 bootstrap simulations. 

Thanks a lot in advance for your precious help 🙂

3 REPLIES 3
ballardw
Super User

What does your data look like?

What specific aggregate do you want?

Do all of these simulations have the same x axis values (since you want to plot them)?

 

If the x values are the same in each simulation then 1) combine the data sets and 2: summarize using the x value as a class variable.

Something like

 

proc summary data=have;

   class x;

   var simulatiedvariable;

   output out=agg max= min= mean= = /autoname;

run;

 

I would include the min, max and possibly confidence limits as well as additional bits to show in the plot for comparisons.

In a data step to the accumulation to have values of the cumulative values.

 

Similar data set of the "actual series of returns" whatever that may be.

Combine the aggregate data with the other data adding a variable to indicate the source.

Plot with source variable a group variable with a step, series or scatter plot using Proc SGplot.

Max05
Obsidian | Level 7

Hi, 

First, thank you very much for your answer! 

I have the actual return series that I can plot on a CDF and I would like to compare this curve with a mean CDF of the 1000 series of return from my bootstrap simulations. 

So my excel file will be composed of 1001 columns of 3110 returns (1000 bootstrap simulations and the actual one). 

At the end I would like to have one graph with two CDFs, one illustrating the series of actual return and one illustrating a mean of the 1000 others. 

I attached an example of subsample of my excel file so that it is probably easier for you to help...

Again, thanks a lot! 🙂

ballardw
Super User

@Max05 wrote:

Hi, 

First, thank you very much for your answer! 

I have the actual return series that I can plot on a CDF and I would like to compare this curve with a mean CDF of the 1000 series of return from my bootstrap simulations. 

So my excel file will be composed of 1001 columns of 3110 returns (1000 bootstrap simulations and the actual one). 

At the end I would like to have one graph with two CDFs, one illustrating the series of actual return and one illustrating a mean of the 1000 others. 

I attached an example of subsample of my excel file so that it is probably easier for you to help...

Again, thanks a lot! 🙂


Why Excel?

You have the data in SAS, plot it in SAS. Do you intend to export 1000 runs and combine them in Excel? Then summarize in Excel?

 

If you want to "aggregate" then there should be some common value to aggregate with.

 

 

Also it appears that you may be thinking of generating 1000 separate columns of data, one for each simulation. That is generally a poor way to approach this. SAS works differently than Excel and attempting to force SAS to work like Excel is just extra work.

 

Many users here don't want to download Excel files because of virus potential, others have such things blocked by security software. Also if you give us Excel we have to create a SAS data set and due to the non-existent constraints on Excel data cells the result we end up with may not have variables of the same type (numeric or character) and even values.

 

Instructions here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the {i} icon or attached as text to show exactly what you have and that we can test code against.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 1005 views
  • 1 like
  • 2 in conversation