[R-SIG-Finance] portfolioMarkowitz function

Diethelm Wuertz wuertz at itp.phys.ethz.ch
Thu Nov 23 16:56:28 CET 2006


Deb Midya wrote:

>Hi!,
>   
>  Thanks in advance.
>   
>  I am using the example function provided in the library fPortfolio.
>   
>  The example is:
>   
>  library(fPortfolio)
>   
>  ## SOURCE("fPortfolio.B2-MarkowitzPortfolio")
>  ## Not run: 
>  ## berndtInvest -
>  data(berndtInvest)
>  # Exclude Date, Market and Interest Rate columns from data frame,
>  # then multiply by 100 for percentual returns ...
>  berndtAssets = berndtInvest[, -c(1, 11, 18)]
>  rownames(berndtAssets) = berndtInvest[, 1]
>  head(berndtAssets)
>  
>  ## portfolioMarkowitz - 
>  myPortfolio = portfolioMarkowitz(x = berndtAssets, targetReturn = 20/100/12)
>   
>  I need to clarify the followings:
>   
>  1. targetReturn = 20/100/12
>  
>
targetReturn = 0.0167
20 devided by 100 devided by 12

>   
>  I could not follow the format used for targetReturn. How can I explain the values 20, 100 and 12?
>   
>  2. What is the objective function? 
>
Mean-variance Portfolio Problem ...

>and
>   
>  3. What are the constraints?
>  
>
no short selling bigger than 0 smaller than 1 for each asset ....

>   
>  I am looking forward for your response.
>   
>  Regards,
>   
>  Debabrata (Deb)
>  
>
The result:

Title:
 Mean-Variance Portfolio Optimization

Call:
 portfolioMarkowitz(x = berndtAssets, targetReturn = 20/100/12)

Portfolio Weights:
    2    5    7    9   10   13   14
0.53 0.03 0.15 0.08 0.08 0.02 0.12

Sum of Weights:
 [1] 1

Target Return(s):
 [1] 0.0167

Target Risk(s):
       [,1]
[1,] 0.037

Description:
 [1] "Thu Nov 23 16:49:18 2006"

The solution is for the Mean-Variance Portfolio optimization problem 
according
to Markowitz, short selling forbidden. The target return is just 
20/100/12 = 0.0167.
The investment in asset No 2 is 53%, in asset no 7 15% and so on.

Diethelm Wuertz

>   
>
> 
>---------------------------------
>
>	[[alternative HTML version deleted]]
>
>_______________________________________________
>R-SIG-Finance at stat.math.ethz.ch mailing list
>https://stat.ethz.ch/mailman/listinfo/r-sig-finance
>
>  
>



More information about the R-SIG-Finance mailing list