Brian,

I appreciate the suggests, however that isn't the issue.

The "c" is from the example in the rmetrics book.
Removing it doesn't change the results at all.

Additionally, I am using the portfolioConstraints function.

--
Noah Silverman
UCLA Department of Statistics
8208 Math Sciences Building
Los Angeles, CA 90095

On Apr 9, 2012, at 5:59 PM, Brian G. Peterson wrote:

> I don't really use fPortfolio much, except for comparison, and I never
> use the function tangencyPortfolio, but the Portfolio Optimization with
> R/Rmetrics book suggests that you should be using the
> portfolioConstraints function.  It also seems that your use of the c()
> operator is misplaced, creating a character vector of what should be a
> string.
> 
> 
> On Mon, 2012-04-09 at 17:47 -0700, Noah Silverman wrote:
>> Hi,
>> 
>> I'm using fPortfolio to analyze some equities.  It works well.
>> 
>> mySpec <- portfolioSpec()
>> myPort <- tangencyPortfolio(thisHist, mySpec)
>> 
>> 
>> I was asked to include a constraint that each stock gets at least 1% of the allocation.
>> 
>> Following the documentation for fPortfolio fails
>> 
>> mySpec <- portfolioSpec()
>> constraints <- c("minW[1:portSize]=0.01")
>> myConst <- portfolioConstraints(thisHist, mySpec, constraints)
>> myPort <- tangencyPortfolio(thisHist, mySpec, myConst)
>> 
>> The error is rather cryptic:
>> 
>> Error in as.character.default(x) : 
>>  no method for coercing this S4 class to a vector
>> 
>> 
>> Does anyone have any suggestions?
>> 
>> 
>> 
>> --
>> Noah Silverman
>> UCLA Department of Statistics
>> 8208 Math Sciences Building
>> Los Angeles, CA 90095
>> 
>> 
>> 	[[alternative HTML version deleted]]
>> 
>> _______________________________________________
>> R-SIG-Finance@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
>> -- Subscriber-posting only. If you want to post, subscribe first.
>> -- Also note that this is not the r-help list where general R questions should go.
> 
> -- 
> Brian G. Peterson
> http://braverock.com/brian/
> Ph: 773-459-4973
> IM: bgpbraverock
> 


	[[alternative HTML version deleted]]

