Re: Welcome to the "R-SIG-Finance" mailing list

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Re: Welcome to the "R-SIG-Finance" mailing list

I am looking at using PortfolioAnalytics to optimize portfolio with constrained tracking error.

looking at below code I got some questions. <- function(R, weights, Rb, min.te = 0.02, max.te = 0.05, scale = 12){
  # calculate the portfolio return
  r <- Return.portfolio(R = R, weights = weights)
  # align the indexes
  Rb <- Rb[index(r)]
  te <- sd(r - Rb) * sqrt(scale)
  # penalize tracking error outside of [min.te, max.te] range
  out <- 0
  if(te > max.te)
    out <- (te - max.te) * 10000
  if(te < min.te)
    out <- (min.te - te) * 10000

Do I need a series of stock returns as well as their corresponding weights for the time series in order to run this script? I have stock return series, but don't have stock weights history as I think the purpose was to find the weights for the optimization.

Would someone be able to advise where can I find the source data used from Ross's presentation? I am trying to replicate the code and see how the flow works.


rossb34/PortfolioAnalyticsPresentation2017 - GitHub<>
Presentation for R/Finance 2017. Contribute to rossb34/PortfolioAnalyticsPresentation2017 development by creating an account on GitHub.

many thanks


From: R-SIG-Finance <[hidden email]> on behalf of [hidden email] <[hidden email]>
Sent: 26 October 2018 15:34
To: [hidden email]
Subject: Welcome to the "R-SIG-Finance" mailing list

[[elided Hotmail spam]]

To post to this list, send your message to:

  [hidden email]

General information about the mailing list is at:

If you ever want to unsubscribe or change your options (eg, switch to
or from digest mode, change your password, etc.), visit your
subscription page at:

You can also make such adjustments via email by sending a message to:

  [hidden email]

with the word `help' in the subject or body (don't include the
quotes), and you will get back a message with instructions.

You must know your password to change your options (including changing
the password, itself) or to unsubscribe without confirmation.  It is:


Normally, Mailman will remind you of your mailing list
passwords once every month, although you can disable this if you
prefer.  This reminder will also include instructions on how to
unsubscribe or change your account options.  There is also a button on
your options page that will email your current password to you.

        [[alternative HTML version deleted]]

[hidden email] 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.