BookmarkSubscribeRSS Feed
ilikesas
Barite | Level 11

Hi,

I have historical data with companies, their weekly prices and several informational variables. These variables are proportions and as such range from 0 to 1, and the sum of all the conditions for a given company/date combination adds to one.

Here is a small structure of my data (for simplicity date has only the year)

companydatepricecond1cond2
A2004100.50.5
A2005110.10.9
A2006120.20.8
B2004150.30.7
B2005130.350.65
B20061710

What I would like to do is to create portfolios based on the conditions and find if there are conditions which create better portfolios.

Initially I wanted to manually create portfolios with specific conditions: say 0=< cond1 <0.1,  0.1 =< cond1 <0.2 etc... and see if there is a certain "range" which creates better performing portfolios. But this way can get too long if I have several conditions and I m not sure if it is correct from a statistical point of view.

Thank you!

11 REPLIES 11
PGStats
Opal | Level 21

What do you want to optimize? What is the definition of a "good portfolio"?

PG
ilikesas
Barite | Level 11

Hi PGStats,

by optimization I mean the greatest return of the portfolio (as measured by its average stock price) over a certain period of time.

Thanks

Reeza
Super User

average price over the period or % increase from start of period to end of period?

ilikesas
Barite | Level 11

% increase from start period to end period

thanks!

gergely_batho
SAS Employee

Hi,

What are your decision variables?

You cannot freely choose weights for assets, but you have to choose one of the "conditions" in each line?

Or you have to choose 1 among the many cond1, cond2, condN columns? Or you can choose a weighted combination from the columns?

Is it allowed to re-weight the portfolio at the beginning of each week?

Do you have any constraints?

If you show us one (not necessary optimal) solution, this would help us to understand the problem.

I suggest you redirect this question to the Operations Research community.

ilikesas
Barite | Level 11

Suppose I want to form 10 portfolios: ( 0=< cond1 <0.1) ------- (0.9=<cond1 <1).

Then I calculate each of these portfolio's % price increase from start period to end period and see which portfolios have the biggest increase.

What I need is a procedure which will be statistically correct.

Thank you

Reeza
Super User

The stats part only comes in when looking for the biggest increase, as far as I can see. The rest looks to be a calculation question, and perhaps a finance question. Personally, I want to say a standard ANOVA works but the portfolios could be considered as having dependent components and thus the assumptions are violated.

I would research the literature relevant to my field and see how current papers are comparing portfolios.

Ksharp
Super User

How do you define portfolios ?  Each company can be chosen only once or more times ?

How do you define start period and end period  ?

ilikesas
Barite | Level 11

For example, the "market portfolio" is the average price of all the companies prices.

Each "conditional" portfolio is the average price of all the companies with specific conditions. Over time companies can switch between the conditional portfolios because the proportions of their conditions can vary over time, so every year each portfolio is re-adjusted.

The beginning and end period are simply my beginning and ending years, but I still need all the years in between in order to make graphs and study volatility.

Thankyou

Ksharp
Super User

It looks like not very difficult . Did you follow what Gergely Bathó said . and I think you can write some macro to achieve these goals .

gergely_batho
SAS Employee

Let me further guess: You write for example you can form 10 portfolios. One of them is when 0=< cond1 <0.1. A second one is when 0.1=< cond1 <0.2. Etc.

According what you write, you simply want to evaluate your portfolios: calculate their return. In this case you want to calculate the return of 10 theoretical portfolios.

The choice of those 10 portfolios seems to me ad-doc, unless those condition variables mean something to you. (What is the meaning of cond1, cond2...? What kind of proportions they are? If they are proportions in a portfolio, then each of them should sum to 1 across a year!)

If I use your sample data with your constructed portfolios, portfolio1 is empty, so it's return is 0. Portfolio2 has only one asset in year 2005 in all other years it's empty. It's return is (1-12/11)=0.0909=9.09%  (in year 2005).

Usually, when we talk about portfolios, we also assign weights to assets, (companies) not only just choosing some of the assets.

This can be calculated in SAS, but I think first you should further clarify.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 11 replies
  • 2072 views
  • 0 likes
  • 5 in conversation