Re: [R] fPortfolio constraints, maxsumW

2008-08-13 Thread Yohan Chalabi
 JPB == John P. Burkett [EMAIL PROTECTED]
 on Tue, 12 Aug 2008 10:46:28 -0400

   JPB Running R version 2.6.1 under Gentoo Linux and using the fPortfolio 
   JPB package, I am having trouble specifying a sector constraint. One of the 
   JPB constraints to be imposed is that assets 1 and 2 together account for 
no 
   JPB more than 13.63% of the portfolio.  My attempt at coding that 
   JPB constraint, maxsumW[1:2Assets]=13.63  fails.  The relevant section of 
   JPB my code file and the resulting error message are pasted below. 
   JPB Suggestions about how to correct my coding would be most welcome.
   JPB 
   JPB *Code beings here
   JPB Data = as.timeSeries(Jdata)
   JPB Spec = portfolioSpec()
   JPB setNFrontierPoints(Spec) = 150
   JPB Spec
   JPB Constraint = c(minW[1:nAssets]=0, maxsumW[1:2Assets]=13.63)
   JPB frontier = portfolioFrontier(Data, Spec, Constraint)
   JPB **Error message begins here***
   JPB Error in parse(text = constraints[i]) :
   JPBunexpected symbol in maxsumW[1:2Assets
   JPB **Error message ends here**
   JPB 
   JPB -John



Hi John,

you should use 0.1363 instead of 13.63...

hope this helps,
yohan

-- 
PhD student
Swiss Federal Institute of Technology
Zurich

www.ethz.ch

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] fPortfolio constraints, maxsumW

2008-08-12 Thread John P. Burkett
Running R version 2.6.1 under Gentoo Linux and using the fPortfolio 
package, I am having trouble specifying a sector constraint. One of the 
constraints to be imposed is that assets 1 and 2 together account for no 
more than 13.63% of the portfolio.  My attempt at coding that 
constraint, maxsumW[1:2Assets]=13.63  fails.  The relevant section of 
my code file and the resulting error message are pasted below. 
Suggestions about how to correct my coding would be most welcome.


*Code beings here
Data = as.timeSeries(Jdata)
Spec = portfolioSpec()
setNFrontierPoints(Spec) = 150
Spec
Constraint = c(minW[1:nAssets]=0, maxsumW[1:2Assets]=13.63)
frontier = portfolioFrontier(Data, Spec, Constraint)
**Error message begins here***
Error in parse(text = constraints[i]) :
  unexpected symbol in maxsumW[1:2Assets
**Error message ends here**

-John

--
John P. Burkett
Department of Environmental and Natural Resource Economics
and Department of Economics
University of Rhode Island
Kingston, RI 02881-0808
USA

phone (401) 874-9195

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.