Quantcast

Is there a function to calculate internal rate of return in R?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Is there a function to calculate internal rate of return in R?

Qian Liu
Hi,

I need to calculate the internal rate of return from cash flows, and wonder
if there's such a function in R. I did some internet search and haven't
found anything relevant.

Thanks!

Best,
Qian

        [[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.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Is there a function to calculate internal rate of return in R?

Yihao Lu aeolus_lu

http://albertosantini.blogspot.com/2008/01/xirr.html
Best,
Yihao



> Date: Thu, 23 Jun 2011 15:09:49 -0700
> From: [hidden email]
> To: [hidden email]
> Subject: [R-SIG-Finance] Is there a function to calculate internal rate of return in R?
>
> Hi,
>
> I need to calculate the internal rate of return from cash flows, and wonder
> if there's such a function in R. I did some internet search and haven't
> found anything relevant.
>
> Thanks!
>
> Best,
> Qian
>
> [[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.
     
        [[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.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Is there a function to calculate internal rate of return in R?

Yihao Lu aeolus_lu

also Rory gave a simple way years ago:
Example:

> cf <- c(-10000, 1322, -1200, 12000)
> npv <- function(i, cf, t=seq(along=cf)) sum(cf/(1+i)^t)
> irr <- function(cf) { uniroot(npv, c(0,1), cf=cf)$root }
> irr(cf)
[1] 0.06937691
Best,Yihao



> From: [hidden email]
> To: [hidden email]; [hidden email]
> Date: Thu, 23 Jun 2011 18:36:58 -0400
> Subject: Re: [R-SIG-Finance] Is there a function to calculate internal rate of return in R?
>
>
> http://albertosantini.blogspot.com/2008/01/xirr.html
> Best,
> Yihao
>
>
>
> > Date: Thu, 23 Jun 2011 15:09:49 -0700
> > From: [hidden email]
> > To: [hidden email]
> > Subject: [R-SIG-Finance] Is there a function to calculate internal rate of return in R?
> >
> > Hi,
> >
> > I need to calculate the internal rate of return from cash flows, and wonder
> > if there's such a function in R. I did some internet search and haven't
> > found anything relevant.
> >
> > Thanks!
> >
> > Best,
> > Qian
> >
> > [[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.
>      
> [[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.
     
        [[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.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

plain mean variance optimization

Yihao Lu aeolus_lu

Hi,I wonder if there is any good package to do portfolio allocation/optimization. I would like to start with some plain mean variance optimization, but I wish the package can do more, say with different type of constraints. It will also be great if the package can help estimate optimization parameters.
thanks.
     
        [[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.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

plain mean variance optimization

matthias.kornexl
Hi!
fPortfolio might fit your needs. standard optimizations are implemented
and it's easily customizable. just have a look at the
package-documentation or the RMetrics-site: https://www.rmetrics.org/ 
There you also find some extensions to fPortfolio for more advanced
optimizations.

rds

Matthias



Von:    [hidden email]
An:     [hidden email]
Datum:  24.06.2011 04:28
Betreff:        [R-SIG-Finance] plain mean variance optimization
Gesendet von:   [hidden email]




Hi,I wonder if there is any good package to do portfolio
allocation/optimization. I would like to start with some plain mean
variance optimization, but I wish the package can do more, say with
different type of constraints. It will also be great if the package can
help estimate optimization parameters.
thanks.
 
                 [[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.



----------------------------------------
Raiffeisenlandesbank Niederösterreich-Wien AG  -  Firmensitz Wien -  FN 203160s - Handelsgericht Wien - DVR-Nummer: 0031585

Der Austausch von Nachrichten mit o.a. Absender via e-mail dient ausschliesslich Informationszwecken. Rechtsgeschaeftliche Erklaerungen duerfen ueber dieses Medium nicht ausgetauscht werden.
Correspondence with a.m. sender via e-mail is only for information purposes. This medium is not to be used for the exchange of legally-binding communications.
----------------------------------------

        [[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.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: plain mean variance optimization

Dirk Eddelbuettel
In reply to this post by Yihao Lu aeolus_lu

On 23 June 2011 at 22:25, Yihao Lu aeolus_lu wrote:
|
| Hi,I wonder if there is any good package to do portfolio allocation/optimization. I would like to start with some plain mean variance optimization, but I wish the package can do more, say with different type of constraints. It will also be great if the package can help estimate optimization parameters.

The tseries package has supported that for a decade already, and uses the
quadprog package as a solver.  About that long ago I had written a patch for
it which Adrian included which allowed for short as well as longs (following
the standard approach in Huang and Litzenberger).

Dirk

--
Gauss once played himself in a zero-sum game and won $50.
                      -- #11 at http://www.gaussfacts.com

_______________________________________________
[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.
Loading...