## Constructing the optimal portfolio

Super Contributor
Posts: 452

# Constructing the optimal portfolio

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!

Posts: 5,049

## Re: Constructing the optimal portfolio

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

PG
Super Contributor
Posts: 452

## Re: Constructing the optimal portfolio

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

Super User
Posts: 20,731

## Re: Constructing the optimal portfolio

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

Super Contributor
Posts: 452

## Re: Constructing the optimal portfolio

% increase from start period to end period

thanks!

SAS Employee
Posts: 340

## Re: Constructing the optimal portfolio

Hi,

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.

Super Contributor
Posts: 452

## Re: Constructing the optimal portfolio

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

Super User
Posts: 20,731

## Re: Constructing the optimal portfolio

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.

Super User
Posts: 10,210

## Re: Constructing the optimal portfolio

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

How do you define start period and end period  ?

Super Contributor
Posts: 452

## Re: Constructing the optimal portfolio

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

Super User
Posts: 10,210

## Re: Constructing the optimal portfolio

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 .

SAS Employee
Posts: 340

## Re: Constructing the optimal portfolio

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.

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