[R-SIG-Finance] Return.portfolio issue
ilya.kipnis at gmail.com
Mon May 29 16:51:07 CEST 2017
On Mon, May 29, 2017 at 10:50 AM, ROUX, Nicolas <nicolas.roux at hec.edu>
> So if all the assets are shorted in one period and sum of the weights
> equals -1 (as was the case in my example but hidden columns), the dummy
> variable's weight is 2?
> On 29 May 2017 16:10, "Ilya Kipnis" <ilya.kipnis at gmail.com> wrote:
> Weights need to sum to 1 at every period. Create a dummy asset with return
> of 0 and assign it a weight of 1 - rowSum(weights) and things will work.
> On Mon, May 29, 2017 at 5:49 AM, Brian G. Peterson <brian at braverock.com>
> > On 05/29/2017 02:32 AM, ROUX, Nicolas wrote:
> >> Hello all,
> >> I am trying to backtest a long/short portfolio using Return.Portfolio
> >> but am running into some sort of error, or I do not fully understand how
> >> to use return.portfolio.
> >> For a quarterly rebalancing of shorts, I am providing monthly returns, a
> >> set of negative
> >> weights in an xts format on quarter dates (created by to.period), the
> >> final argument is rebalance_on="quarters".
> >> The result is an set of regular zigzags where the position changes too
> >> regularly. Inline images 2
> >> The code:
> > <...>
> > This isn't exactly a reproducible example.
> > Here is a reproducible example:
> > require(PerformanceAnalytics)
> > data(edhec)
> > data(weights)
> > sweights <- -1 * weights
> > pr <- Return.rebalancing(R=edhec, weights=sweights)
> > charts.PerformanceSummary(pr)
> > It is clearly a bug. We'll take a look.
> > **
> >> I am not sure I understand how the short weights work? Perhaps I should
> >> just use positive weights and minus the returns afterwards?
> >> Any help much appreciated.
> >> Nicolas Roux
> > _______________________________________________
> > R-SIG-Finance at 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.
> [[alternative HTML version deleted]]
> R-SIG-Finance at r-project.org mailing list
> -- 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.
[[alternative HTML version deleted]]
More information about the R-SIG-Finance