Publications by Quantitative Finance Collector

An Interest Rate R Package Plan

07.06.2010

I recently have done some empirical studies on zero-coupon bond modelling and pricing, and plan to create an interest rate R package in order to make it re-usable, as I find there are only two R package on it, one is http://cran.r-project.org/web/packages/termstrc/index.html, the other one is http://cran.r-project.org/web/packages/YieldCurve/inde...

999 sym 2 img

R for Matlab Users

15.06.2010

My favorite software is Matlab, but partly because R is free, more and more people & companies choose to use R as a major working language. Nothing wrong with that, I am at the moment changing some of my Kalman Filter Matlab codes to R.One bothering issue is each software has its own coding rules, for example, in Matlab we use a(1,1) but in R we ...

1425 sym

R Sapply Problem

16.06.2010

Any expert in R please educates me. I have got a problem about the sapply (or lapply), it made me headache for over two hours.As “for loop” is very slow in R, we should try best to avoid using it, and to use vectorization instead. sapply is designed for this, for example, instead of:for (i in 1:10) {z[i] }we could usez It went well, but what ...

1811 sym

Simple Dummy R GUI Generator

01.07.2010

Imagine you finish a dirty coding project and want to present to your boss who is not in a good mood (may not be occasionally), how are you going to start? Show him your hundreads of lines code, point to the lines, explain what the arguments and outputs are? No, it is not a smart way since you are supposed to introduce in a few short sentences. G...

2291 sym 2 img

Excellent R Code Format Package

04.07.2010

I have been looking for this type of package for several days, and luckily found it today. Unquestionable R is powerful, however, R programming is unfriendly as far as I concern, mainly due to the lack of format shortcut, which makes the R codes rather ugly. (It is an absolute advantage of Matlab, for example, ctrl+R for comment, ctrl+T for uncom...

1300 sym 4 img

Handling Large CSV Files in R

09.08.2010

A follow-up of my previous post Excellent Free CSV Splitter. I asked a question at LinkedIn about how to handle large CSV files in R / Matlab. Specifically, Quotationsuppose I have a large CSV file with over 30 million number of rows, both Matlab / R lacks memory when importing the data. Could you share your way to handle this issue? what I am th...

2370 sym

R Reshape Package

06.09.2010

Some of you may know this R reshape package already, I have started to play with it after the post Handling Large CSV Files in R. It is really an excellent one worthing a new post to introduce formally.What is reshape package? reshape: Flexibly reshape data, Reshape lets you flexibly restructure and aggregate data using just two functions: melt a...

1933 sym 4 img

Missing Data in R

12.09.2010

Probably all of us have met the issue of handling missing data, from the basic portfolio correlation matrix estimation, to advanced multiple factor analysis, how to impute missing data remains a hot topic. Missing data are unavoidable, and more encompassing than the ubiquitous association of the term, irgoring missing data will generally lead to ...

3517 sym 2 img

R Optimization Function Test

01.10.2010

Using Kalman Filter for CIR interest rate model parameter estimation was introduced at my previously post Kalman Filter finance, soon after that I got a few comments saying the final results are unstable and highly depend on the initial values, that’s true, local vs global minimum is never ending.This post is therefore a sample test of the opti...

2012 sym 2 img

Liquidity Premium vs Liquidity of Corporate Bonds

14.10.2010

All else equal, investors should require higher returns on assets whose liquidity is lower, in other words, investors demand a higher expected return, and hence larger liquidity premium, by holding a less liquidity asset. Risk & return co-exist.Is this really true for corporate bonds? I run a simple regression using R to test my data, where US co...

2976 sym 8 img