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

yusichen0541@msn.com
hi,


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


looking at below code I got some questions.


te.target <- 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
  out
}

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.


https://github.com/rossb34/PortfolioAnalyticsPresentation2017/blob/master/optimization_script.R

[https://avatars1.githubusercontent.com/u/5797430?s=400&v=4]<https://github.com/rossb34/PortfolioAnalyticsPresentation2017/blob/master/optimization_script.R>

rossb34/PortfolioAnalyticsPresentation2017 - GitHub<https://github.com/rossb34/PortfolioAnalyticsPresentation2017/blob/master/optimization_script.R>
github.com
Presentation for R/Finance 2017. Contribute to rossb34/PortfolioAnalyticsPresentation2017 development by creating an account on GitHub.




many thanks

jojo



________________________________
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:

  https://stat.ethz.ch/mailman/listinfo/r-sig-finance

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:

  https://stat.ethz.ch/mailman/options/r-sig-finance/yusichen0541%40msn.com


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:

  495530az

Normally, Mailman will remind you of your r-project.org 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
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.