[R-SIG-Finance] About multi-dimension array on Binomial TreeStructure

Enrico Schumann enricoschumann at yahoo.de
Sat Jun 19 09:47:24 CEST 2010



higham (2002) is a very good paper on implementing tree models. 
@ARTICLE{Higham2002,
  author = {Desmond J. Higham},
  title = {{Nine Ways to Implement the Binomial Method for Option Valuation
	in MATLAB}},
  journal = {SIAM Review},
  year = {2002},
  volume = {44},
  pages = {661--677},
  number = {4}
}

higham uses matlab*, but the same principles (eg, how to get rid off the
inner loop in a standard tree) also apply to R. the paper can be found here
http://personal.strath.ac.uk/d.j.higham/reps.html. [ an R implementation is
in here http://ssrn.com/abstract=1341181 ]


hth,
enrico

* slightly off-topic: the paper was written before the advent of the JIT
compiler in matlab, so the speedups gained from vectorization are smaller
today. there is also a JIT project in R:
http://www.milbo.users.sonic.net/ra/index.html 



 

> -----Ursprüngliche Nachricht-----
> Von: r-sig-finance-bounces at stat.math.ethz.ch 
> [mailto:r-sig-finance-bounces at stat.math.ethz.ch] Im Auftrag 
> von Ulrich Staudinger
> Gesendet: Freitag, 18. Juni 2010 08:36
> An: JOSH C. CHIEN
> Cc: R-Finance
> Betreff: Re: [R-SIG-Finance] About multi-dimension array on 
> Binomial TreeStructure
> 
> Josh,
> 
> I can't help you with your coding problem, but with another one ..
> there is no single right way in finance and the best solution 
> depends on the environment. the used programming styles, 
> languages,methodologies, etc. vary between the houses as much 
> as its personel does. Whatever works!
> 
> Cheers,
> Ulrich
> 
> On Fri, Jun 18, 2010 at 7:52 AM, JOSH C. CHIEN 
> <cchien at alumni.poly.edu>wrote:
> 
> >
> > Hi R user,
> > I'm translating VBA code to R code for work.
> > Here is example,  I hope your guys can guide me how to program 
> > multi-dimension array, s price path, on tree structure.
> >
> > VBA Code
> > Dim s() as double
> > Dim v() as double
> > ReDim s(0 To NoSteps, 0 To NoSteps)
> > ReDim V(0 To NoSteps, 0 To NoSteps)
> >
> > I just know that one-dimension array can be created by calling 
> > numeric() and two-dim by calling matrix().
> > But, more two-dim array, how to create ? ( ex. trinomial Tree, HJM, 
> > BGM...... ) Is it right way to code on programing in finance ?
> > thanks a lot.
> >
> > Sincerely,
> > Josh
> >        [[alternative HTML version deleted]]
> >
> > _______________________________________________
> > R-SIG-Finance at stat.math.ethz.ch 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.
> >
> 
> 
> 
> --
> Kind regards,
> Ulrich B. Staudinger
> 
> 	[[alternative HTML version deleted]]
> 
> _______________________________________________
> R-SIG-Finance at stat.math.ethz.ch 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.
> Internal Virus Database is out of date.
> Checked by AVG - www.avg.com
> Version: 9.0.829 / Virus Database: 271.1.1/2929 - Release 
> Date: 06/10/10 08:35:00
> 



More information about the R-SIG-Finance mailing list