Chase the Devil
https://chasethedevil.github.io/
Recent content on Chase the DevilHugo -- gohugo.ioen-usCopyright 2006-2018 Fabien Le Floc'h. This work is licensed under a Creative Commons Attribution 4.0 International License.Mon, 13 May 2024 20:56:42 +0100News on the COS Method Truncation
https://chasethedevil.github.io/post/cos_method_truncation/
Mon, 13 May 2024 20:56:42 +0100https://chasethedevil.github.io/post/cos_method_truncation/The COS method is a fast way to price vanilla European options under stochastic volatility models with a known characteristic function. There are alternatives, explored in previous blog posts. A main advantage of the COS method is its simplicity. But this comes at the expense of finding the correct values for the truncation level and the (associated) number of terms.
A related issue of the COS method, or its more fancy wavelet cousin the SWIFT method, is to require a huge (>65K) number of points to reach a reasonable accuracy for some somewhat extreme choices of Heston parameters.Variance Swap Term-Structure under Schobel-Zhu
https://chasethedevil.github.io/post/unrealistic_variance_swaps_under_schobel_zhu/
Tue, 26 Mar 2024 12:56:42 +0100https://chasethedevil.github.io/post/unrealistic_variance_swaps_under_schobel_zhu/I never paid too much attention to it, but the term-structure of variance swaps is not always realistic under the Schobel-Zhu stochastic volatility model.
This is not fundamentally the case with the Heston model, the Heston model is merely extremely limited to produce either a flat shape or a downward sloping exponential shape.
Under the Schobel-Zhu model, the price of a newly issued variance swap reads $$ V(T) = \left[\left(v_0-\theta\right)^2-\frac{\eta^2}{2\kappa}\right]\frac{1-e^{-2\kappa T}}{2\kappa T}+2\theta(v_0-\theta)\frac{1-e^{-\kappa T}}{\kappa T}+\theta^2+\frac{\eta^2}{2\kappa},,$$ where \( \eta \) is the vol of vol.New Basket Expansions and Cash Dividends
https://chasethedevil.github.io/post/new_basket_approximation_and_cash_dividends/
Sat, 23 Mar 2024 09:56:42 +0100https://chasethedevil.github.io/post/new_basket_approximation_and_cash_dividends/In the previous post, I presented a new stochastic expansion for the prices of Asian options. The stochastic expansion is generalized to basket options in the paper, and can thus be applied on the problem of pricing vanilla options with cash dividends.
I have updated the paper with comparisons to more direct stochastic expansions for pricing vanilla options with cash dividends, such as the one of Etoré and Gobet, and my own refinement on it.New Approximations for the Prices of Asian and basket Options
https://chasethedevil.github.io/post/new_asian_approximation/
Sun, 17 Mar 2024 12:56:42 +0100https://chasethedevil.github.io/post/new_asian_approximation/Many years ago, I had applied the stochastic expansion technique of Etore and Gobet to a refined proxy, in order to produce more accurate prices for vanilla options with cash dividends under the Black-Scholes model with deterministic jumps at the dividend dates. Any approximation for vanilla basket option prices can also be applied on this problem, and the sophisticated Curran geometric conditioning was found to be particularly competitive in The Pricing of Vanilla Options with Cash Dividends as a Classic Vanilla Basket Option Problem.Easy Mistake With the Log-Euler Discretization On Black-Scholes
https://chasethedevil.github.io/post/logeuler_not_exact/
Mon, 11 Mar 2024 20:56:42 +0100https://chasethedevil.github.io/post/logeuler_not_exact/In the Black-Scholes model with a term-structure of volatilities, the Log-Euler Monte-Carlo scheme is not necessarily exact.
This happens if you have two assets \(S_1\) and \(S_2\), with two different time varying volatilities \(\sigma_1(t), \sigma_2(t) \). The covariance from the Ito isometry from \(t=t_0\) to \(t=t_1\) reads $$ \int_{t_0}^{t_1} \sigma_1(s)\sigma_2(s) \rho ds, $$ while a naive log-Euler discretization may use $$ \rho \bar\sigma_1(t_0) \bar\sigma_2(t_0) (t_1-t_0). $$ In practice, the \( \bar\sigma_i(t_0) \) are calibrated such that the vanilla option prices are exact, meaning $$ \bar{\sigma}_i^2(t_0)(t_1-t_0) = \int_{t_0}^{t_1} \sigma_i^2(s) ds.Roughness of Pure Jumps
https://chasethedevil.github.io/post/roughness_of_jumps/
Mon, 18 Dec 2023 20:56:42 +0100https://chasethedevil.github.io/post/roughness_of_jumps/In my previous blog post, I looked at the roughness of the SVCJ stochastic volatility model with jumps (in the volatility). In this model, the jumps occur randomly, but at discrete times. And with typical parameters used in the litterature, the jumps are not so frequent. It is thus more interesting to look at the roughness of pure jump processes, such as the CGMY process.
The CGMY process is more challenging to simulate.Roughness of Stochastic Volatility with Jumps
https://chasethedevil.github.io/post/roughness_of_stochastic_volatility/
Thu, 07 Dec 2023 20:56:42 +0100https://chasethedevil.github.io/post/roughness_of_stochastic_volatility/I was wondering if adding jumps to stochastic volatility, as is done in the SVCJ model of Duffie, Singleton and Pan “Transform Analysis and Asset Pricing for Affine Jump-Diffusion” also in Broadie and Kaya “Exact simulation of stochastic volatility and other affine jump diffusion processes”, would lead to rougher paths, or if it would mislead the roughness estimators.
The answer to the first question can almost be answered visually: The parameters used are the one from Broadie and Kaya: v0=0.Measuring Roughness with Julia
https://chasethedevil.github.io/post/measuring_roughness_with_julia/
Tue, 07 Nov 2023 20:56:42 +0100https://chasethedevil.github.io/post/measuring_roughness_with_julia/I received a few e-mails asking me for the code I used to measure roughness in my preprint on the roughness of the implied volatility. Unfortunately, the code I wrote for this paper is not in a good state, it’s all in one long file line by line, not necessarily in order of execution, with comments that are only meaningful to myself.
In this post I will present the code relevant to measuring the oxford man institute roughness with Julia.Black with Bachelier
https://chasethedevil.github.io/post/black_with_bachelier/
Tue, 03 Oct 2023 20:56:42 +0100https://chasethedevil.github.io/post/black_with_bachelier/I was experimenting with the recent SABR basket approximation of Hagan. The approximation only works for the normal SABR model, meaning beta=0 in SABR combined with the Bachelier option formula.
I was wondering how good the approximation would be for two flat smiles (in terms of Black volatilities). I then noticed something that escaped me before: the normal SABR model is able to fit the pure Black model (with constant vols) extremely well.Clenshaw-Curtis Quadrature Implementation by FFT in Practice
https://chasethedevil.github.io/post/clenshaw_fft_implementation/
Wed, 27 Sep 2023 20:56:42 +0100https://chasethedevil.github.io/post/clenshaw_fft_implementation/The Clenshaw-Curtis quadrature is known to be competitive with Gauss quadratures. It has several advantages:
the weights are easy and fast to compute. adaptive / doubling quadratures are possible with when the Chebyshev polynomial of the second kind is used for the quadrature. the Chebyshev nodes may also be used to interpolate some costly function. The wikipedia article has a relatively detailed description on how to compute the quadrature weights corresponding to the Chebyshev polynomial of the second kind (where the points -1 and 1 are included), via a type-I DCT.Ghost Vacations
https://chasethedevil.github.io/post/ghost_vacations/
Sun, 20 Aug 2023 20:56:42 +0100https://chasethedevil.github.io/post/ghost_vacations/During my vacation, I don’t know why, but I looked at some stability issue with ghost points and the explicit method. I was initially trying out ghost points with the explicit runge kutta Chebyshev/Legendre/Gegenbauer technique and noticed some explosion in some cases.
I cornered it down to a stability issue of the standard explicit Euler method with ghost (or fictitious) points. The technique is described in the book “Paul Wilmott on Quantitative Finance” (also in Paul Wilmott introduces quantitative finance), which I find quite good, although I have some friends who are not much fond of it.Maximum Implied Variance Slope
https://chasethedevil.github.io/post/maximum_implied_variance_slope/
Mon, 22 May 2023 23:56:42 +0100https://chasethedevil.github.io/post/maximum_implied_variance_slope/The paper The Moment Formula for Implied Volatility at Extreme Strikes by Roger Lee redefined how practioners extrapolate the implied volatility, by showing that the total implied variance can be at most linear in the wings, with a slope below 2.
Shortly after, the SVI model of Jim Gatheral, with its linear wings, started to become popular.
In a recent paper in collaboration with Winfried Koller, we show that the asymptotic bounds are usually overly optimistic.The Return of the Arbitrage in the Perfect Volatility Surface
https://chasethedevil.github.io/post/the_return_of_the_arbitrage/
Wed, 29 Mar 2023 23:56:42 +0100https://chasethedevil.github.io/post/the_return_of_the_arbitrage/In a Wilmott article from 2018 (Wilmott magazine no. 97) titled “Arbitrage in the perfect volatility surface”, Uwe Wystup points out some interesting issues on seemingly innocuous FX volatility surfaces:
a cubic spline tends to produce artificial peaks/modes in the density. SVI not arbitrage-free even on seemingly trivial input. The examples provided are indeed great and the remarks very valid. There is more to it however:
a cubic spline on strikes or log-moneyness does not produce the artificial peak.Princeton Fintech and Quant conference of December 2022
https://chasethedevil.github.io/post/princeton_fintech_conference/
Sun, 04 Dec 2022 07:56:42 +0100https://chasethedevil.github.io/post/princeton_fintech_conference/I recently presented my latest published paper On the Bachelier implied volatility at extreme strikes at the Princeton Fintech and Quant conference. The presenters were of quite various backgrounds. The first presentations were much more business oriented with lots of AI keywords, but relatively little technical content while the last presentation was about parallel programming. Many were a pitch to recruit to employees.
The diversity was interesting: it was refreshing to hear about quantitative finance from vastly different perspectives.Desktop Linux in 2022
https://chasethedevil.github.io/post/linux-in-2022/
Wed, 26 Oct 2022 07:56:42 +0100https://chasethedevil.github.io/post/linux-in-2022/I have been a long time user of Fedora at work and have been happy quite happy about it. Around 6 months ago, I moved to Manjaro under VirtualBox in a Windows host, because the company imposes the use of a VPN client that does not run on Linux. It’s much less great for several reasons:
VirtualBox makes everything graphics much slower. It is still way better than WSL2 as I found WSL2 to be a poor man’s Linux, where graphics is via some half broken X11 client for Windows.Roughness of the Implied Volatility
https://chasethedevil.github.io/post/implied_volatility_roughness/
Sat, 09 Jul 2022 07:56:42 +0100https://chasethedevil.github.io/post/implied_volatility_roughness/This is a follow up of my previous post on rough volatility. I recently tried to reproduce the results of the paper Rough Volatility: Fact or Artefact? as I was curious to apply the technique using different inputs. The 5-minutes SPX realized volatility is freely available in CSV format at the Oxford-Man Institute of Quantitative Finance and it is thus relatively straightforward to reproduce the numbers presented in the paper.Volatility: Rough or Not? A Short Review
https://chasethedevil.github.io/post/rough-volatility-or-not-a-review/
Tue, 10 May 2022 17:56:42 +0100https://chasethedevil.github.io/post/rough-volatility-or-not-a-review/It is well-known that the assumption of constant volatility in the Black-Scholes model for pricing financial contracts is wrong and may lead to serious mispricing, especially for any exotic derivative contracts. A classic approach is to use a deterministic local volatility model to take into account the variation both in the time dimension and in the underlying asset price dimension. But the model is still not realistic in terms of forward smile (the implied volatilities of forward starting options).Monte-Carlo Parallelization: to vectorize or not?
https://chasethedevil.github.io/post/monte-carlo-vectorization-or-not/
Sat, 09 Apr 2022 21:56:42 +0100https://chasethedevil.github.io/post/monte-carlo-vectorization-or-not/When writing a Monte-Carlo simulation to price financial derivative contracts, the most straightforward is to code a loop over the number of paths, in which each path is fully calculated. Inside the loop, a payoff function takes this path to compute the present value of the contract on the given path. The present values are recorded to lead to the Monte-Carlo statistics (mean, standard deviation). I ignore here any eventual callability of the payoff which may still be addressed with some work-arounds in this setup.More Automatic Differentiation Awkwardness
https://chasethedevil.github.io/post/more-automatic-differentiation-awkwardness/
Tue, 04 Jan 2022 21:56:42 +0100https://chasethedevil.github.io/post/more-automatic-differentiation-awkwardness/This blog post from Jherek Healy presents some not so obvious behavior of automatic differentiation, when a function is decomposed into the product of two parts where one part goes to infinity and the other to zero, and we know the overall result must go to zero (or to some other specific number). This decomposition may be relatively simple to handle for the value of the function, but becomes far less trivial to think of in advance, at the derivative level.Quadprog in Julia
https://chasethedevil.github.io/post/quadprog-in-julia/
Sun, 21 Nov 2021 13:56:42 +0100https://chasethedevil.github.io/post/quadprog-in-julia/As described on wikipedia, a quadratic programming problem with n variables and m constraints is of the form $$ \min(-d^T x + 1/2 x^T D x) $$ with the constraints \( A^T x \geq b_0 \), were \(D\) is a \(n \times n\)-dimensional real symmetric matrix, \(A\) is a \(n \times m\)-dimensional real matrix, \( b_0 \) is a \(m\)-dimensional vector of constraints, \( d \) is a \(n\)-dimensional vector, and the variable \(x\) is a \(n\)-dimensional vector.Positive Stochastic Collocation
https://chasethedevil.github.io/post/positive_stochastic_collocation/
Tue, 31 Aug 2021 07:56:42 +0100https://chasethedevil.github.io/post/positive_stochastic_collocation/In the context of my thesis, I explored the use of stochastic collocation to capture the marginal densities of a positive asset. Indeed, most financial asset prices must be non-negative. But the classic stochastic collocation towards the normally distributed random variable, is not.
A simple tweak, proposed early on by Grzelak, is to assume absorption and use the put-call parity to price put options (which otherwise depend on the left tail).My Review of Steven Koonin's Book on Climate
https://chasethedevil.github.io/post/koonin-on-climate-book-review/
Mon, 30 Aug 2021 07:56:42 +0100https://chasethedevil.github.io/post/koonin-on-climate-book-review/Steven Koonin, who was Secretary for Science, Department of Energy, in the Obama administration recently wrote a somewhat controversial book on climate science with the title Unsettled. I was curious to read what kind of critics a physicist who partly worked in the field had, even if I believe that climate warming is real, and humans have an influence on it. It turns out that some of his remarks regarding models are relevant way beyond climate science, but some other subjects are not as convincing.Github and SSH setup
https://chasethedevil.github.io/post/github-and-ssh/
Mon, 16 Aug 2021 07:56:42 +0100https://chasethedevil.github.io/post/github-and-ssh/Github recently moved to support only ssh access via public/private keys. As I use github to host this blog, I was impacted.
The setup on Linux is not very complicated, and relatively well documented on Github itself but all the steps are not listed in a simplistic manner, and some Google search is still required to find out how to setup multiple private keys for various different servers or different repos.Covid-19 Fake News
https://chasethedevil.github.io/post/covid19-fake-news/
Tue, 10 Aug 2021 07:56:42 +0100https://chasethedevil.github.io/post/covid19-fake-news/One thing that motivated me for vaccination is the fake news propaganda against the Covid-19 vaccines.
A mild example relates to the data from Israel about the delta variant. This kind of article, with the title “Covid 19 Case Data in Israel, a Troubling Trend”, puts emphasis on the doubts on the effectivness of the vaccine:
the vaccine appears to have a negligible effect on an individual as to whether he/she catches the current strain.Are traditional banks ready for the 21st century?
https://chasethedevil.github.io/post/are-tradional-banks-ready-for-the-21st/
Sat, 12 Jun 2021 07:56:42 +0100https://chasethedevil.github.io/post/are-tradional-banks-ready-for-the-21st/This is a follow up on my parents phishing scam.
After several weeks, my parents and I were finally able to have a real world meeting with the advisor at the bank. The advisor is a young woman with an obvious background in sales.
In order to process the paperwork around the reimbursement of the phishing scam, the main issue was the request of the original phishing e-mail by the bank, as my mother had deleted the e-mail.Yesterday, Pirates Took Over My Parents Bank Account
https://chasethedevil.github.io/post/yesterday-pirates-took-over-my-parents-bank-account/
Wed, 10 Mar 2021 07:56:42 +0100https://chasethedevil.github.io/post/yesterday-pirates-took-over-my-parents-bank-account/This is the story of their hack.
Yesterday evening, I received a call from my mother, frantic over the phone. She says she sees alerts of withdrawals from her bank account on her phone, with new alerts every 5 minutes or so. I try to ask her if she clicked recently on some e-mail related to her bank. She is so panicked that I don’t manage to have an answer. While trying to understand if those alerts are real or not, my wife suggests immediately that my mother should call her bank.Remarkable Coincidences, Bad Book?
https://chasethedevil.github.io/post/reghai_remarkable_coincidences/
Sat, 21 Nov 2020 07:56:42 +0100https://chasethedevil.github.io/post/reghai_remarkable_coincidences/I stumbled upon a new short book Financial Models in Production from O. Kettani and A. Reghai. A page attracted my attention
A page from Kettani and Reghai's book. This is the same example as I used on my blog, where I also present the Li’s SOR method combined with the good initial guess from Stefanica. The idea has also been expanded on in Jherek Healy’s book. What is shocking is that, beside reusing my example, they reuse my timing for Jäckel and my implementation is in Google Go, with a timing done on some older laptop.Bad papers and the roots of high degree polynomials
https://chasethedevil.github.io/post/bad-papers-polynomial-roots/
Sat, 07 Nov 2020 07:56:42 +0100https://chasethedevil.github.io/post/bad-papers-polynomial-roots/I was wondering what were exactly the eigenvalues of the Mersenne-Twister random number generator transition matrix. An article by K. Savvidy sparked my interest on this. This article mentioned a poor entropy (sum of log of eigenvalues amplitudes which are greater than 1), with eigenvalues falling almost on the unit circle.
The eigenvalues are also the roots of the characteristic polynomial. It turns out, that for jumping ahead in the random number sequence, we use the characteristic polynomial.Disaster Capitalism - Summer Reading Review
https://chasethedevil.github.io/post/disaster-capitalism/
Fri, 06 Nov 2020 20:56:42 +0100https://chasethedevil.github.io/post/disaster-capitalism/Several years ago, I read the book No Logo from Naomi Klein. I did not find it particularly good, but it did raise a valid concern overall. This summer I read Shock Therapy - The rise of disaster capitalism. It suffers from some of the same flaws as No Logo, namely a lot of repetition of the same idea. Here, the underlying idea is that neoliberalism does not work in practice, and often ends up being some kind of corporatism.More on random number generators
https://chasethedevil.github.io/post/more-on-random-number-generators/
Sat, 10 Oct 2020 20:56:42 +0100https://chasethedevil.github.io/post/more-on-random-number-generators/My previous post described the recent view on random number generators, with a focus on the Mersenne-Twister war.
Since, I have noticed another front in the war of the random number generators:
An example in dimension 121 from K Savvidy where L’Ecuyer MRG32k3a fails to compute the correct result, regardless of the seed. This is a manufactured example, such that the vector, used in the example, falls in the dual lattice of the generator.The war of the random number generators
https://chasethedevil.github.io/post/war-of-the-random-number-generators/
Thu, 17 Sep 2020 20:56:42 +0100https://chasethedevil.github.io/post/war-of-the-random-number-generators/These days, there seems to be some sort of small war to define what is a modern good random number generators to advise for simulations. Historically, the Mersenne-Twister (MT thereafter) won this war. It is used by default in many scientific libraries and software, even if there has been a few issues with it:
A bad initial seed may make it generate a sequence of low quality for at least as many as 700K numbers.Sobol with 64-bits integers
https://chasethedevil.github.io/post/sobol-64-bits/
Wed, 09 Sep 2020 20:56:42 +0100https://chasethedevil.github.io/post/sobol-64-bits/A while ago, I wondered how to make some implementation of Sobol support 64-bits integers (long) and double floating points. Sobol is the most used quasi random number generator (QRNG) for (quasi) Monte-Carlo simulations.
The standard Sobol algorithms are all coded with 32-bits integers and lead to double floating point numbers which can not be smaller than \( 2^{-31} \). I was recently looking back at the internals at Sobol generators, and noticed that generating with 64-bits integers would not help much.Intel failure and the future of computing
https://chasethedevil.github.io/post/intel-failures-and-the-future/
Fri, 24 Jul 2020 20:56:42 +0100https://chasethedevil.github.io/post/intel-failures-and-the-future/What has been happening to the INTC stock today may be revealing of the future. The stock dropped more than 16%, mainly because they announced that their 7nm process does not work (well) and they may rely on an external foundry for their processors. Initially, in 2015, they thought they would have 8nm process by 2017, and 7nm by 2018. They are more than 3 years late.
Intel used to be a leader in the manufacturing process for microprocessor.March 9, 2020 crash - where will CAC40 go?
https://chasethedevil.github.io/post/mar9-cac40-crash/
Mon, 09 Mar 2020 21:56:42 +0100https://chasethedevil.github.io/post/mar9-cac40-crash/The stock market crashed by more than 7% on March 9, 2020. It is one of the most important drop since September 2001. I looked at BNP warrant prices on the CAC40 French index, with a maturity of March 20, 2020 , to see what they would tell about the market direction on the day of the crash. This is really a not-so-scientific experiment.
The quotes I got were quite noisy.42
https://chasethedevil.github.io/post/42/
Thu, 05 Dec 2019 20:56:42 +0100https://chasethedevil.github.io/post/42/Today my 6-years old son came with a math homework. The stated goal was to learn the different ways to make 10 out of smaller numbers. I was impressed. Immediately, I wondered
how many ways are there to make 10 out of smaller numbers?
This is one of the beauties of maths: a very simple problem, which a 6-years old can understand, may actually be quite fundamental. If you want to solve this in the general case, for any number instead of 10, you end up with the partition function.Numba, Pypy Overrated?
https://chasethedevil.github.io/post/python-numba-overrated/
Tue, 12 Feb 2019 20:56:42 +0100https://chasethedevil.github.io/post/python-numba-overrated/Many benchmarks show impressive performance gains with the use of Numba or Pypy. Numba allows to compile just-in-time some specific methods, while Pypy takes the approach of compiling/optimizing the full python program: you use it just like the standard python runtime. From those benchmarks, I imagined that those tools would improve my 2D Heston PDE solver performance easily. The initialization part of my program contains embedded for loops over several 10Ks elements.About
https://chasethedevil.github.io/about/
Mon, 17 Dec 2018 10:05:07 +0100https://chasethedevil.github.io/about/I just moved my blog to a static website, created with Hugo, I explain the reasons why here. You can find more about me on my linkedin profile. In addition you might find the following interesting:
List of quantitative finance papers I have freely available on SSRN TR-BDF2 for Stable American Option Pricing. This is the first draft, not the final version that was published in the Journal of Computational Finance.Fixing NaNs in Quadprog
https://chasethedevil.github.io/post/quadprog-nans/
Sun, 07 Oct 2018 20:56:42 +0100https://chasethedevil.github.io/post/quadprog-nans/Out of curiosity, I tried quadprog as open-source quadratic programming convex optimizer, as it is looks fast, and the code stays relatively simple. I however stumbled on cases where the algorithm would return NaNs even though my inputs seemed straighforward. Other libraries such as CVXOPT did not have any issues with those inputs.
Searching on the web, I found that I was not the only one to stumble on this kind of issue with quadprog.On the Probability of a Netflix Stock Crash
https://chasethedevil.github.io/post/nflx-stock-crash-probability/
Thu, 12 Jul 2018 20:56:42 +0100https://chasethedevil.github.io/post/nflx-stock-crash-probability/This is a follow up to my previous post where I explore the probability of a TSLA stock crash, reproducing the results of Timothy Klassen.
According to the implied cumulative probability density, TSLA has around 15% chance of crashing below $100. Is this really high compared to other stocks? or is it the interpretation of the data erroneous?
Here I take a look at NFLX (Netflix). Below is the implied volatility according to three different models.On the Probability of a TSLA Stock Crash
https://chasethedevil.github.io/post/tsla-stock-crash-probability/
Wed, 11 Jul 2018 20:56:42 +0100https://chasethedevil.github.io/post/tsla-stock-crash-probability/Timothy Klassen had an interesting post on linkedin recently, with the title “the options market thinks there is a 16% chance that Tesla will not exist in January 2020”. As I was also recently looking at the TSLA options, I was a bit intrigued. I looked at the option chain on July 10th, and implied the European volatility from the American option prices. I then fit a few of my favorite models: Andreasen-Huge with Tikhonov regularization, the lognormal mixture, and a polynomial collocation of degree 7.The Fourth Moment of the Normal SABR Model
https://chasethedevil.github.io/post/normal-sabr-fourth-moment/
Mon, 11 Jun 2018 20:56:42 +0100https://chasethedevil.github.io/post/normal-sabr-fourth-moment/I was wondering if I could use the SABR moments to calibrate a model to SABR parameters directly. It turns out that the SABR moments have relatively simple expressions when \(\beta=0\), that is, for the normal SABR model (with no absorption). This is for the pure SABR stochatic volatility model, not the Hagan approximation. For the Hagan approximation, we would need to use the replication by vanilla options to compute the moments.Implying the Probability Density from Market Option Prices (Part 2)
https://chasethedevil.github.io/post/implying-the-probability-density-from-market-option-prices-ii/
Sun, 27 May 2018 20:56:42 +0100https://chasethedevil.github.io/post/implying-the-probability-density-from-market-option-prices-ii/This is a follow-up to my posts on the implied risk-neutral density (RND) of the SPW options before and after the big volatility change that happened in early February with two different techniques: a smoothing spline on the implied volatilities and a Gaussian kernel approach.
The Gaussian kernel (as well as to some extent the smoothing spline) let us believe that there are multiple modes in the distribution (multiple peaks in the density).Senior Developers Don't Know OO Anymore
https://chasethedevil.github.io/post/senior-developers-dont-know-oo-anymore/
Thu, 08 Mar 2018 20:56:42 +0100https://chasethedevil.github.io/post/senior-developers-dont-know-oo-anymore/It has been a while since the good old object-oriented (OO) programming is not trendy anymore. Functional programming or more dynamic programming (Python-based) have been the trend, with an excursion in template based programming for C++ guys. Those are not strict categories: Python can be used in a very OO way, but it’s not how it is marketed or considered by the community.
Recently, I have seen some of the ugliest refactoring in my life as a programmer, done by someone with at least 10 years of experience programming in Java.Implying the Probability Density from Market Option Prices
https://chasethedevil.github.io/post/implying-the-probability-density-from-market-option-prices/
Tue, 13 Feb 2018 20:56:42 +0100https://chasethedevil.github.io/post/implying-the-probability-density-from-market-option-prices/In the previous post, I showed a plot of the probability implied from SPW options before and after the big volatility change of last week. I created it from a least squares spline fit of the market mid implied volatilities (weighted by the inverse of the bid-ask spread). While it looks reasonable, the underlying technique is not very robust. It is particularly sensitive to the number of options strikes used as spline nodes.Where is the S&P 500 going to end?
https://chasethedevil.github.io/post/spx500_bets_after_rates_hike/
Tue, 06 Feb 2018 19:56:42 +0100https://chasethedevil.github.io/post/spx500_bets_after_rates_hike/Yesterday the American stocks went a bit crazy along with the VIX that jumped from 17.50 to 38. It’s not exactly clear why, the news mention that the Fed might raise its interest rates, the bonds yield have been recently increasing substantially, and the market self-correcting after stocks grew steadily for months in a low VIX environment.
I don’t exactly follow the SPX/SPW options daily. But I had taken a snapshot two weeks ago when the market was quiet.Discrete Sine Transform via the FFT
https://chasethedevil.github.io/post/discrete_sine_transform_fft/
Mon, 05 Feb 2018 13:56:42 +0100https://chasethedevil.github.io/post/discrete_sine_transform_fft/Several months ago, I had a quick look at a recent paper describing how to use Wavelets to price options under stochastic volatility models with a known characteristic function. The more classic method is to use some numerical quadrature directly on the Fourier integral as described in this paper for example. When I read the paper, I was skeptical about the Wavelet approach, since it looked complicated, and with many additional parameters.Quantitative Finance Books Citing My Papers
https://chasethedevil.github.io/post/quantitative_finance_books/
Sat, 09 Dec 2017 13:56:42 +0100https://chasethedevil.github.io/post/quantitative_finance_books/I would have never really expected that when I started writing papers, but little by little there is a growing list of books citing my papers:
Applied Quantitative Finance for Equity Derivatives by Jherek Healy: the most recent book on equity derivatives refers to several of my papers. In contrast with many other books, the author goes beyond and provides additional insights on the papers. Interest Rate Derivatives Explained: Volume 2: Term Structure and Volatility Modelling by Jörg Kienitz and Peter Casper.Google phones are overrated
https://chasethedevil.github.io/post/google_phones_are_overrated/
Mon, 02 Oct 2017 23:56:42 +0100https://chasethedevil.github.io/post/google_phones_are_overrated/It is a relatively common belief that the vanilla Android experience is better, as it runs smoother. The Samsung Touchwiz is often blamed for making things slow and not more practical.
I have had a Nexus 6 for a couple of years and I noticed the slowdowns after each update, up to a point where it sometimes took a few seconds to open the phone app, or to display the keyboard.SVN is dead
https://chasethedevil.github.io/post/svn_is_dead/
Tue, 26 Sep 2017 23:56:42 +0100https://chasethedevil.github.io/post/svn_is_dead/A few years ago, when Git was rising fast and SVN was already not hype anymore, a friend thought that SVN was for many organizations better suited than Git, with the following classical arguments, which were sound at the time:
Who needs decentralization for a small team or a small company working together? SVN is proven, works well and is simple to use and put in place. Each argument is in reality not so strong.The Neural Network in Your CPU
https://chasethedevil.github.io/post/the_neural_network_in_your_cpu/
Sun, 06 Aug 2017 23:56:42 +0100https://chasethedevil.github.io/post/the_neural_network_in_your_cpu/Machine learning and artificial intelligence are the current hype (again). In their new Ryzen processors, AMD advertises the Neural Net Prediction. It turns out this is was already used in their older (2012) Piledriver architecture used for example in the AMD A10-4600M. It is also present in recent Samsung processors such as the one powering the Galaxy S7. What is it really?
The basic idea can be traced to a paper from Daniel Jimenez and Calvin Lin “Dynamic Branch Prediction with Perceptrons”, more precisely described in the subsequent paper “Neural methods for dynamic branch prediction”.Benham disc in web canvas
https://chasethedevil.github.io/post/benham_disc_in_web_canvas/
Mon, 10 Jul 2017 23:56:42 +0100https://chasethedevil.github.io/post/benham_disc_in_web_canvas/Around 15 years ago, I wrote a small Java applet to try and show the Benham disk effect. Even back then applets were already passé and Flash would have been more appropriate. These days, no browser support Java applets anymore, and very few web users have Java installed. Flash also mostly disappeared. The web canvas is today’s standard allowing to embbed animations in a web page. This effect shows color perception from a succession of black and white pictures.Blogs on Quantitative Finance
https://chasethedevil.github.io/post/quantitative_finance_blogs/
Wed, 21 Jun 2017 23:56:42 +0100https://chasethedevil.github.io/post/quantitative_finance_blogs/There are not many blogs on quantitative finance that I read. Blogs are not so popular anymore with the advent of the various social networks (facebook, stackoverflow, google plus, reddit, …). Here is a small list:
Clarus FT: often interesting statistics on the swap market, clearing, plus the more technical articles from Gary. Quants R Us: A relatively new blog with a promising starting post analyzing Andreasen-Huge one-step local-volatility algorithm with a Spline Fooling around with Quantlib: the blog from Peter Caspers, also relevant to non-Quantlib professionals has original insights such as Smile dynamics by densities or the Supernatural Libor Coupons.Typo in Hyman non-negative constraint - 28 years later
https://chasethedevil.github.io/post/typo-in-hyman-non-negative-constraint/
Tue, 23 May 2017 23:56:42 +0100https://chasethedevil.github.io/post/typo-in-hyman-non-negative-constraint/In their paper “Nonnegativity-, Monotonicity-, or Convexity-Preserving Cubic and Quintic Hermite Interpolation”, Dougherty, Edelman and Hyman present a simple filter on the first derivatives to maintain positivity of a cubic spline interpolant.
Unfortunately, in their main formula for non-negativity, they made a typo: the equation (3.3) is not consistent with the equation (3.1): the \( \Delta x_{i-1/2} \) is interverted with \( \Delta x_{i+1/2} \).
It was not obvious to find out which equation was wrong since there is no proof in the paper.Implied Volatility from Black-Scholes price
https://chasethedevil.github.io/post/implied-volatility-from-black-scholes-price/
Sun, 02 Apr 2017 07:56:42 +0100https://chasethedevil.github.io/post/implied-volatility-from-black-scholes-price/Dan Stefanica and Rados Radoicic propose a quite good initial guess in their very recent paper An Explicit Implied Volatility Formula. Their formula is simple, fast to compute and results in an implied volatility guess with a relative error of less than 10%.
It is more robust than the rational fraction from Minquiang Li: his rational fraction is only valid for a fixed range of strikes and maturities. The new approximation is mathematically proved accurate across all strikes and all maturities.The VIX starts smiling
https://chasethedevil.github.io/post/vix-starts-smiling/
Tue, 21 Mar 2017 07:56:42 +0100https://chasethedevil.github.io/post/vix-starts-smiling/The VIX implied volatilities used to look like a logarithmic function of the strikes. I don’t look at them often, but today, I noticed that the VIX had the start of a smile shape.
1m VIX implied volatilities on March 21, 2017 with strictly positive volume. Very few strikes trades below the VIX future level (12.9). All of this is likely because the VIX is unusually low: not many people are looking to trade it much lower.When SVI Breaks Down
https://chasethedevil.github.io/post/when-svi-breaks-down/
Thu, 16 Mar 2017 07:56:42 +0100https://chasethedevil.github.io/post/when-svi-breaks-down/In order to fit the implied volatility smile of equity options, one of the most popular parameterization is Jim Gatheral’s SVI, which I have written about before here.
It turns out that in the current market conditions, SVI does not work well for short maturities. SPX options expiring on March 24, 2017 (one week) offer a good example. I paid attention to include only options with non zero volume, that is options that are actually traded.Brownian Bridge and Discrete Random Variables
https://chasethedevil.github.io/post/brownian-bridge-and-discrete-sampling/
Thu, 26 Jan 2017 14:55:32 +0100https://chasethedevil.github.io/post/brownian-bridge-and-discrete-sampling/The new Heston discretisation scheme I wrote about a few weeks ago makes use a discrete random variable matching the first five moments of the normal distribution instead of the usual normally distributed random variable, computed via the inverse cumulative distribution function. Their discrete random variable is: $$\xi = \sqrt{1-\frac{\sqrt{6}}{3}} \quad \text{ if } U_1 < 3,,$$ $$ \xi =-\sqrt{1-\frac{\sqrt{6}}{3}} \quad \text{ if } U_1 > 4,,$$ $$\xi = \sqrt{1+\sqrt{6}} \quad \text{ if } U_1 = 3,,$$ $$\xi = -\sqrt{1+\sqrt{6}} \quad \text{ if } U_1 = 4,,$$ with \(U_1 \in \{0,1,…,7\}\)Samsung Wireless Printer under Fedora 25
https://chasethedevil.github.io/post/samsung_wireless_printer_fedora25/
Thu, 26 Jan 2017 09:55:32 +0100https://chasethedevil.github.io/post/samsung_wireless_printer_fedora25/This is a note for those who want to setup a Samsung wireless printer under Linux. It is quite simple, this forum post helped me, the actual useful steps on Fedora 25 are:
download tar.gz linux driver from Samsung website. As root, unpack & install: tar xvzf SamsungPrinterInstaller.tar.gz cd uld ./install.sh in the printer menu, lookup for the wireless key (8 digits), connect to the printer Wifi network with a computer using the wireless key, enter the network gateway IP, this is typically http://192.A new scheme for Heston - Part 2
https://chasethedevil.github.io/post/a-new-scheme-for-heston_part2/
Mon, 23 Jan 2017 07:55:32 +0100https://chasethedevil.github.io/post/a-new-scheme-for-heston_part2/A couple weeks ago, I wrote about a new Heston discretisation scheme which was at least as accurate as Andersen QE scheme and faster, called DVSS2.
It turns out that it does not behave very well on the following Vanilla forward start option example (which is quite benign). The Heston parameters comes from a calibration to the market and are
$$v_0= 0.0718, \kappa= 1.542, \theta= 0.0762, \sigma= 0.582, \rho= -0.352$$Power management and XFCE under Fedora 25
https://chasethedevil.github.io/post/xfce_fedora25/
Thu, 19 Jan 2017 09:55:32 +0100https://chasethedevil.github.io/post/xfce_fedora25/The gnome shell has been crashing on me more regularly lately. XFCE is a good and fast more tradional desktop, but, from past experiences, it does not play well with power management if you only install it via
dnf install @xfce-desktop-environment My typical experience is a black screen after resuming from suspend (sometimes, not always), or hibernate (always) and most of the time I end up just rebooting. It turns out this is all caused by the interaction between the gdm login daemon and xfce.Equivalence between floating-strike and fixed-strike Asian options
https://chasethedevil.github.io/post/floating_strike_fixed_strike_asian_equivalence/
Wed, 18 Jan 2017 09:55:32 +0100https://chasethedevil.github.io/post/floating_strike_fixed_strike_asian_equivalence/Many papers present formulae to price Asian options in the Black-Scholes world only for the fixed strike Asian case, that is a contract that pays \( \max(A-K,0)\) at maturity \(T\) where \(A = \sum_{i=0}^{n-1} w_i S(t_i) \) is the Asian average.
More generally, this can be seen as the payoff of a Basket option where the underlyings are just the same asset but at different times. And any Basket option formula can actually be used to price fixed-strike Asian options by letting the correlation correspond to the correlation between the asset at the averaging times and the variances correspond to the variance at each averaging time.Bachelier Normal Volatility Asymptotics
https://chasethedevil.github.io/post/normal_volatility_asymptotics/
Tue, 17 Jan 2017 09:55:32 +0100https://chasethedevil.github.io/post/normal_volatility_asymptotics/It is relatively well known that the Black-Scholes volatility can not grow faster than \(\sqrt{\ln(K)}\). The rule is also sometimes simply stated as “the implied variance can not grow faster than linear” (in log-moneyness). The proof comes from Roger Lee “The moment formula for implied volatility at extreme strikes” but the rule was suggested earlier, for example in Hodge’s paper from 1996 “Arbitrage bounds of the implied volatility strike and term structures of European-style options”.A new scheme for Heston
https://chasethedevil.github.io/post/a-new-scheme-for-heston/
Fri, 06 Jan 2017 07:55:32 +0100https://chasethedevil.github.io/post/a-new-scheme-for-heston/I stumbled recently upon a new Heston discretisation scheme, in the spirit of Alfonsi, not more complex and more accurate.
My first attempt at coding the scheme resulted in a miserable failure even though the described algorithm looked not too difficult. I started wondering if the paper, from a little known Lithuanian mathematical journal, was any good. Still, the math in it is very well written, with a great emphasis on the settings for each proposition.Andreasen-Huge interpolation - Don't stay flat
https://chasethedevil.github.io/post/dont-stay-flat-with-andreasen-huge-interpolation/
Tue, 13 Dec 2016 09:55:32 +0100https://chasethedevil.github.io/post/dont-stay-flat-with-andreasen-huge-interpolation/Jesper Andreasen and Brian Huge propose an arbitrage-free interpolation method based on a single-step forward Dupire PDE solution in their paper Volatility interpolation. To do so, they consider a piecewise constant representation of the local volatility in maturity time and strike where the number of constants matches the number of market option prices.
An interesting example that shows some limits to the technique as described in Jesper Andreasen and Brian Huge paper comes from Nabil Kahale paper on an arbitrage-free interpolation of volatilities.Put-Call parity and the log-transformed Black-Scholes PDE
https://chasethedevil.github.io/post/put_call_parity_with_log_transformed_pde/
Mon, 05 Dec 2016 09:55:32 +0100https://chasethedevil.github.io/post/put_call_parity_with_log_transformed_pde/We will assume zero interest rates and no dividends on the asset \(S\) for clarity. The results can be easily generalized to the case with non-zero interest rates and dividends. Under those assumptions, the Black-Scholes PDE is: $$ \frac{\partial V}{\partial t} + \frac{1}{2}\sigma^2 S^2 \frac{\partial^2 V}{\partial S^2} = 0.$$
An implicit Euler discretisation on a uniform grid in \(S\) of width \(h\) with linear boundary conditions (zero Gamma) leads to:Benaim et al. extrapolation does not work on equities
https://chasethedevil.github.io/post/issues_with_bdk_extrapolation/
Tue, 04 Oct 2016 09:55:32 +0100https://chasethedevil.github.io/post/issues_with_bdk_extrapolation/We have seen earlier that a simple parabola allows to capture the smile of AAPL 1m options surprisingly well. For very high and very low strikes, the parabola does not obey Lee’s moments formula (the behavior in the wings needs to be at most linear in variance/log-moneyness).
Extrapolating the volatility smile in the low or high strikes in a smooth \(C^2\) fashion is however not easy. A surprisingly popular so called “arbitrage-free” method is the extrapolation of Benaim, Dodgson and Kainth developed to remedy the negative density of SABR in interest rates as well as to give more control over the wings.AES for Monte-Carlo
https://chasethedevil.github.io/post/aes_for_monte_carlo/
Wed, 17 Aug 2016 09:55:32 +0100https://chasethedevil.github.io/post/aes_for_monte_carlo/In finance, and also in science, the Mersenne-Twister is the de-factor pseudo-random number generator (PRNG) for Monte-Carlo simulations. By the way, there is a recent 64-bit maximally equidistributed version called MEMT19937 with 53-bit double precision floating point numbers in mind.
D.E. Shaw paper Parallel Random Numbers: As easy as 1, 2, 3 makes a bold remark: since specific AES instructions have been available since 2010 in most x86 processors, why not use them?A review of Thomas Piketty - Le capital au XXI siecle
https://chasethedevil.github.io/post/piketty_capital/
Tue, 02 Aug 2016 09:55:32 +0100https://chasethedevil.github.io/post/piketty_capital/I found back some old notes I had written about the book “Le capital au XXI siecle” from Thomas Piketty. It took me a while to finish that book last summer.
So many journalists have written around Piketty, that I had to buy the book and read it. It turns out that some of the criticism I have read is not really founded once one reads the book, but here are other real obvious criticisms that I suprisingly did not hear.Number of regressors in a BSDE
https://chasethedevil.github.io/post/number_of_regressors_in_bdse/
Tue, 26 Jul 2016 09:55:32 +0100https://chasethedevil.github.io/post/number_of_regressors_in_bdse/Last year, I was kindly invited at the workshop on Models and Numerics in Financial Mathematics at the Lorentz center. It was surprinsgly interesting on many different levels. Beside the relatively large gap between academia and the industry, which this workshop was trying to address, one thing that struck me is how difficult it was for people of slightly different specialties to communicate.
It seemed that mathematicians of different countries working on different subjects related to backward stochastic differential equations (BSDEs) would not truly understand each other.Shooting arbitrage - part II
https://chasethedevil.github.io/post/shooting_arbitrage2/
Tue, 05 Jul 2016 09:55:32 +0100https://chasethedevil.github.io/post/shooting_arbitrage2/In my previous post, I looked at de-arbitraging volatilities of options of a specific maturity with the shooting method. In reality it is not so practical. While the local volatility will be continuous at the given expiry \(T\), it won’t be so at the times \( t \lt T \) because of the interpolation or extrapolation in time. If we consider a single market expiry at time \(T\), it is standard practice to extrapolate the implied volatility flatly for \(t \lt T\), that is, \(w(y,t) = v_T(y) t\) where the variance at time \(T\) is defined as \(v_T(y)= \frac{1}{T}w(y,T)\).Shooting arbitrage - part I
https://chasethedevil.github.io/post/shooting_arbitrage/
Wed, 22 Jun 2016 09:55:32 +0100https://chasethedevil.github.io/post/shooting_arbitrage/In my previous post, I looked at de-arbitraging volatilities of options of a specific maturity with SVI (re-)calibration. The penalty method can be used beyond SVI. For example I interpolate here with a cubic spline on 11 equidistant nodes the original volatility slice that contains arbitrages and then minimize with Levenberg-Marquardt and the negative local variance denominator penalty on 51 equidistant points. This results in a quite small adjustment to the original volatilities:Dearbitraging a weak smile on SVI with Damghani's method
https://chasethedevil.github.io/post/damghani_dearbitraging_a_weak_smile_on_svi/
Wed, 15 Jun 2016 09:55:32 +0100https://chasethedevil.github.io/post/damghani_dearbitraging_a_weak_smile_on_svi/Yesterday, I wrote about some calendar spread arbitrages with SVI. Today I am looking at the famous example of butterfly spread arbitrage from Axel Vogt. $$(a, b, m, \rho, \sigma) = (−0.0410, 0.1331, 0.3586, 0.3060, 0.4153)$$ The parameters obey the weak no-arbitrage constraint of Gatheral, and yet produce a negative density, or equivalently, a negative denominator in the local variance Dupire formula. Those parameters are mentioned in Jim Gatheral and Antoine Jacquier paper on arbitrage free SVI volatility surfaces and also in Damghani’s paper dearbitraging a weak smile.Arbitrage in Zeliade's SVI example
https://chasethedevil.github.io/post/svi_zeliade_arbitrage/
Tue, 14 Jun 2016 09:55:32 +0100https://chasethedevil.github.io/post/svi_zeliade_arbitrage/Zeliade wrote an excellent paper about the calibration of the SVI parameterization for the volatility surface in 2008. I just noticed recently that their example calibration actually contained strong calendar spread arbitrages. This is not too surprising if you look at the parameters, they vary wildly between the first and the second expiry.
T a b rho m s 0.082 0.027 0.234 0.068 0.100 0.028 0.16 0.030 0.125 -1.0 0.074 0.Dupire Local Volatility with Cash Dividends Part 2
https://chasethedevil.github.io/post/dupire_cash_dividend_part2/
Sun, 29 May 2016 17:01:00 +0200https://chasethedevil.github.io/post/dupire_cash_dividend_part2/I had a look at how to price under Local Volatility with Cash dividends in my previous post. I still had a somewhat large error in my FDM price. After too much time, I managed to find the culprit, it was the extrapolation of the prices when applying the jump continuity condition \(V(S,t_\alpha^-) = V(S-\alpha, t_\alpha^+) \) for an asset \(S\) with a cash dividend of amount \(\alpha\) at \( t_\alpha \).Dupire Local Volatility with Cash Dividends
https://chasethedevil.github.io/post/dupire_cash_dividend/
Thu, 19 May 2016 17:01:00 +0200https://chasethedevil.github.io/post/dupire_cash_dividend/The Dupire equation for local volatility has been derived under the assumption of Martingality, that means no dividends or interest rates. The extension to continuous dividend yield is described in many papers or books:
With cash dividends however, the Black-Scholes formula is not valid anymore if we suppose that the asset jumps at the dividend date of the dividend amount. There are various relatively accurate approximations available to price an option supposing a constant (spot) volatility and jumps, for example, this one.SVI, SABR, or parabola on AAPL?
https://chasethedevil.github.io/post/svi_sabr_or_parabola/
Thu, 12 May 2016 19:32:42 +0200https://chasethedevil.github.io/post/svi_sabr_or_parabola/In a previous post, I took a look at least squares spline and parabola fits on AAPL 1m options market volatilities. I would have imagined SVI to fit even better since it has 5 parameters, and SABR to do reasonably well.
It turns out that the simple parabola has the lowest RMSE, and SVI is not really better than SABR on that example.
SVI, SABR, least squares parabola fitted to AAPL 1m options Note that this is just one single example, unlikely to be representative of anything, but I thought this was interesting that in practice, a simple parabola can compare favorably to more complex models.Adaptive Filon quadrature for stochastic volatility models
https://chasethedevil.github.io/post/filon_for_heston/
Thu, 12 May 2016 19:08:18 +0200https://chasethedevil.github.io/post/filon_for_heston/A while ago, I have applied a relatively simple adaptive Filon quadrature to the problem of volatility swap pricing. The Filon quadrature is an old quadrature from 1928 that allows to integrate oscillatory integrand like \(f(x)\cos(k x) \) or \(f(x)\sin(k x) \). It turns out that combined with an adaptive Simpson like method, it has many advantages over more generic adaptive quadrature methods like Gauss-Lobatto, which is often used on similar problems.Least Squares Rational Function
https://chasethedevil.github.io/post/rational_fit/
Thu, 21 Apr 2016 16:37:24 +0200https://chasethedevil.github.io/post/rational_fit/In my paper “Fast and Accurate Analytic Basis Point Volatility”, I use a table of Chebyshev polynomials to provide an accurate representation of some function. This is an idea I first saw in the Faddeeva package to represent the cumulative normal distribution with high accuracy, and high performance. It is also simple to find out the Chebyshev polynomials, and which intervals are the most appropriate for those, which makes this technique quite appealing.Least Squares Spline for Volatility Interpolation
https://chasethedevil.github.io/post/least_squares_spline/
Fri, 19 Feb 2016 18:29:33 +0100https://chasethedevil.github.io/post/least_squares_spline/I am experimenting a bit with least squares splines. Existing algorithms (for example from the NSWC Fortran library) usually work with B-splines, a relatively simple explanation of how it works is given in this paper (I think this is how De Boor coded it in the NSWC library). Interestingly there is an equivalent formulation in terms of standard cubic splines, although it seems that the pseudo code on that paper has errors.The Mystic Parabola
https://chasethedevil.github.io/post/mystic_parabola/
Tue, 16 Feb 2016 22:13:53 +0100https://chasethedevil.github.io/post/mystic_parabola/I recently had some fun trying to work directly with the option chain from the Nasdaq website. The data there is quite noisy, but a simple parabola can still give an amazing fit. I will consider the options of maturity two years as illustration. I also relied on a simple implied volatility algorithm that can be summarized in the following steps:
Compute a rough guess for the forward price by using interest, borrow curves and by extrapolating the dividends.Yahoo Finance Implied Volatility
https://chasethedevil.github.io/post/yahoo_finance_implied_volatility/
Wed, 03 Feb 2016 16:45:58 +0100https://chasethedevil.github.io/post/yahoo_finance_implied_volatility/The option chain on Yahoo finance shows an implied volatility number for each call or put option in the last column. I was wondering a bit how they computed that number. I did not exactly find out their methodology, especially since we don’t even know the daycount convention used, but I did find that it was likely just garbage.
A red-herring is for example the large discrepancy between put vols and call vols.Is Tufte overrated?
https://chasethedevil.github.io/post/is_tufte_overrated/
Wed, 03 Feb 2016 16:11:30 +0100https://chasethedevil.github.io/post/is_tufte_overrated/Tufte proposes interesting guidelines to present data, or even to design written semi-scientific papers or books. Some advices are particularly relevant like the careful use of colors (don’t use all the colors of the rainbow just because you can), and in general don’t add lines in a graph or designs that are not directly relevant to the message that needs to be conveyed. There is also a parallel with Feynman message against (Nasa) Powerpoint presentations.Linear and Flat forward interpolation with cash dividends
https://chasethedevil.github.io/post/linear_flat_forward_interpolation/
Tue, 19 Jan 2016 09:55:32 +0100https://chasethedevil.github.io/post/linear_flat_forward_interpolation/When the dividend curve is built from discrete cash dividends, the dividend yield is discontinuous at the dividend time as the asset price jumps from the dividend amount. This can be particularly problematic for numerical schemes like finite difference methods. In deed, a finite difference grid will make use of the forward yield (eventually adjusted to the discretisation scheme), which explodes then. Typically, if one is not careful about this, then increasing the number of time steps does not increase accuracy anymore, as the spike just becomes bigger on a smaller time interval.Moved to hugo
https://chasethedevil.github.io/post/moved-to-hugo/
Sun, 20 Dec 2015 21:00:57 +0100https://chasethedevil.github.io/post/moved-to-hugo/I moved my blog from blogger to Hugo. Blogger really did not evolve since Google take-over in 2003. Wordpress is today much nicer and prettier. It’s clear that Google did not invest at all, possibly because blogs are passé. Compared to mid 2000, there are very few blogs today. Even programming blogs are scarce. It could be interesting to quantify this. My theory is that it is the direct consequence of the popularity of social networks, and especially facebook (possibly also stackoverflow for programmers): people don’t have time anymore to write as their extra-time is used on social networks.Controlling the SABR wings with Hagan PDE
https://chasethedevil.github.io/post/controlling-the-sabr-wings-with-hagan-pde/
Tue, 15 Dec 2015 10:56:00 +0000https://chasethedevil.github.io/post/controlling-the-sabr-wings-with-hagan-pde/On the Wilmott forum, Pat Hagan has recently suggested to cap the equivalent local volatility in order to control the wings and better match CMS prices. It also helps making the SABR approximation better behaved as the expansion is only valid when
$$ 1 + 2\frac{\rho\nu}{\alpha}y(K)+\frac{\nu^2}{\alpha^2}y^2(K) $$is close to 1.
In the PDE approach (especially the non transformed one), it is very simple, one just needs to update the equivalent local vol as $$\alpha K^\beta \min\left(M, \sqrt{1 + 2\frac{\rho\nu}{\alpha}y(K)+\frac{\nu^2}{\alpha^2}y^2(K)}\right)$$Broken Internet?
https://chasethedevil.github.io/post/broken-internet/
Mon, 09 Nov 2015 13:40:00 +0000https://chasethedevil.github.io/post/broken-internet/There is something funny going on with upcoming generic top level domains (gTLDs), they seem to be looked up in a strange manner (at least on latest Linux). For example:
ping chrome
or
ping nexus
returns 127.0.53.53.
While existing official gTLDs don't (ping dental returns "unknown host" as expected). I first thought it was a network misconfiguration, but as I am not the only one to notice this, it's likely a genuine internet issue.Holiday's read - DFW - Everything and more
https://chasethedevil.github.io/post/holidays-read---dfw---everything-and-more/
Sun, 01 Nov 2015 17:55:00 +0000https://chasethedevil.github.io/post/holidays-read---dfw---everything-and-more/I am ambivalent towards David Foster Wallace. He can write the most creative sentences and make innocuous subjects very interesting. At the same time, i never finished his bookInfinite Jest, partly because the characters names are too awkward for me so that i never exactly remember who is who, but also because the story itself is a bit too crazy.
I knew however that a non fiction book on the subject of infinity written by him would make for a very interesting read.Crank-Nicolson and Rannacher Issues with Touch options
https://chasethedevil.github.io/post/crank-nicolson-and-rannacher-issues-with-touch-options/
Wed, 30 Sep 2015 13:34:00 +0000https://chasethedevil.github.io/post/crank-nicolson-and-rannacher-issues-with-touch-options/I just stumbled upon this particularly illustrative case where the Crank-Nicolson finite difference scheme behaves badly, and the Rannacher smoothing (2-steps backward Euler) is less than ideal: double one touch and double no touch options.
It is particularly evident when the option is sure to be hit, for example when the barriers are narrow, that is our delta should be around zero as well as our gamma. Let's consider a double one touch option with spot=100, upBarrier=101, downBarrier=99.Clouds
https://chasethedevil.github.io/post/clouds/
Wed, 02 Sep 2015 15:36:00 +0000https://chasethedevil.github.io/post/clouds/I was wondering how to generate some nice cloudy like texture with a simple program. I first thought about using the Brownian motion, but of course if one uses it raw, with one pixel representing one movement in time, it's just going to look like a very noisy and grainy picture like this:
Normal noise
There is however a nice continuous representation of the Brownian motion : the Paley-Wiener representationGo for Monte-Carlo
https://chasethedevil.github.io/post/go-for-monte-carlo/
Sat, 22 Aug 2015 16:13:00 +0000https://chasethedevil.github.io/post/go-for-monte-carlo/I have looked a few months ago already at Julia, Dart, Rust and Scala programming languages to see how practical they could be for a simple Monte-Carlo option pricing.
I forgot the Go language. I had tried it 1 or 2 years ago, and at that time, did not enjoy it too much. Looking at Go 1.5 benchmarks on the computer language shootout, I was surprised that it seemed so close to Java performance now, while having a GC that guarantees pauses of less 10ms and consuming much less memory.Bumping Correlations
https://chasethedevil.github.io/post/bumping-correlations/
Sat, 25 Jul 2015 18:36:00 +0000https://chasethedevil.github.io/post/bumping-correlations/In his book "Monte Carlo Methods in Finance", P. Jäckel explains a simple way to clean up a correlation matrix. When a given correlation matrix is not positive semi-definite, the idea is to do a singular value decomposition (SVD), replace the negative eigenvalues by 0, and renormalize the corresponding eigenvector accordingly.
One of the cited applications is "stress testing and scenario analysis for market risk" or "comparative pricing in order to ascertain the extent of correlation exposure for multi-asset derivatives"Andreasen Huge extrapolation
https://chasethedevil.github.io/post/andreasen-huge-extrapolation/
Mon, 13 Jul 2015 17:35:00 +0000https://chasethedevil.github.io/post/andreasen-huge-extrapolation/There are not many arbitrage free extrapolation schemes. Benaim et al. extrapolation is one of the few that claims it. However, despite the paper’s title, it is not truely arbitrage free. The density might be positive, but the forward is not preserved by the implied density. It can also lead to wings that don’t obey Lee’s moments condition.
On a Wilmott forum, P. Caspers proposed the following counter-example based on extrapolating SABR: \( \alpha=15%, \beta=80%, \nu=50%, \rho=-48%, f=3%, T=20.Unintuitive behavior of the Black-Scholes formula - negative volatilities in displaced diffusion extrapolation
https://chasethedevil.github.io/post/unintuitive-behavior-of-the-black-scholes-formula---negative-volatilities-in-displaced-diffusion-extrapolation/
Tue, 07 Jul 2015 16:43:00 +0000https://chasethedevil.github.io/post/unintuitive-behavior-of-the-black-scholes-formula---negative-volatilities-in-displaced-diffusion-extrapolation/I am looking at various extrapolation schemes of the implied volatilities. An interesting one I stumbled upon is due to Kahale. Even if his paper is on interpolation, there is actually a small paragraph on using the same kind of function for extrapolation. His idea is to simply lookup the standard deviation \( \Sigma \) and the forward \(f\) corresponding to a given market volatility and slope: $$ c_{f,\Sigma} = f N(d_1) - k N(d_2)$$ with $$ d_1 = \frac{\log(f/k)+\Sigma^2 /2}{\Sigma} $$Linux Desktops in 2015
https://chasethedevil.github.io/post/linux-desktops-in-2015/
Wed, 24 Jun 2015 18:53:00 +0000https://chasethedevil.github.io/post/linux-desktops-in-2015/I seem to never be entirely happy with any of the linux desktops these days. I have used XFCE on Ubuntu quite a bit in the past year, it mostly works, but I still had minor annoyances:
sometimes (rarely) my laptop would not wake up from sleep. notifications sometimes keep popping up too much. on my desktop, experienced strong tearing issues with the Radeon graphic card, except with some very specific combination of video player settings and desktop settings (and then I had annoying redraw issue when pushing volume up/down in movies).Square Root Crank-Nicolson
https://chasethedevil.github.io/post/square-root-crank-nicolson/
Fri, 19 Jun 2015 16:41:00 +0000https://chasethedevil.github.io/post/square-root-crank-nicolson/C. Reisinger kindly pointed out to me this paper around square root Crank-Nicolson. The idea is to apply a square root of time transformation to the PDE, and discretize the resulting PDE with Crank-Nicolson. Two reasons come to mind to try this: the square root transform will result in small steps initially, where the solution is potentially not so smooth, making Crank-Nicolson behave better. it is the natural time of the Brownian motion.Decoding Hagan's arbitrage free SABR PDE derivation
https://chasethedevil.github.io/post/decoding-hagans-arbitrage-free-sabr-pde-derivation/
Fri, 08 May 2015 16:50:00 +0000https://chasethedevil.github.io/post/decoding-hagans-arbitrage-free-sabr-pde-derivation/Here are the main steps of Hagan derivation. Let's recall his notation for the SABR model where typically, \\(C(F) = F^\beta\\) First, he defines the moments of stochastic volatility: Then he integrates the Fokker-Planck equation over all A, to obtain On the backward Komolgorov equation, he applies a Lamperti transform like change of variable: And then makes another change of variable so that the PDE has the same initial conditions for all moments: This leads to It turns out that there is a magical symmetry for k=0 and k=2.Matching Hagan PDE SABR with the one-step Andreasen-Huge SABR
https://chasethedevil.github.io/post/matching-hagan-pde-sabr-with-the-one-step-andreasen-huge-sabr/
Thu, 30 Apr 2015 17:16:00 +0000https://chasethedevil.github.io/post/matching-hagan-pde-sabr-with-the-one-step-andreasen-huge-sabr/I looked nearly two years ago already at the arbitrage free SABR of Andreasen-Huge in comparison to the arbitrage free PDE of Hagan and showed how close the ideas were: Andreasen-Huge relies on the normal Dupire forward PDE using a slightly simpler local vol (no time dependent exponential term) while Hagan works directly on the Fokker-Planck PDE (you can think of it as the Dupire Forward PDE for the density) and uses an expansion of same order as the original SABR formula (which leads to an additional exponential term in the local volatility).Modern Programming Language for Monte-Carlo
https://chasethedevil.github.io/post/modern-programming-language-for-monte-carlo/
Sat, 18 Apr 2015 22:58:00 +0000https://chasethedevil.github.io/post/modern-programming-language-for-monte-carlo/A few recent programming languages sparked my interest:
Julia because of the wide coverage of mathematical functions, and great attention to quality of the implementations. It has also some interesting web interface. Dart: because it’s a language focused purely on building apps for the web, and has a supposedly good VM. Rust: it’s the latest fad. It has interesting concepts around concurrency and a focus on being low level all the while being simpler than C.Volatility Swap vs Variance Swap Replication - Truncation
https://chasethedevil.github.io/post/volatility-swap-vs-variance-swap-replication---truncation/
Mon, 16 Mar 2015 14:39:00 +0000https://chasethedevil.github.io/post/volatility-swap-vs-variance-swap-replication---truncation/I have looked at jump effects on volatility vs. variance swaps. There is a similar behavior on tail events, that is, on truncating the replication. One main problem with discrete replication of variance swaps is the implicit domain truncation, mainly because the variance swap equivalent log payoff is far from being linear in the wings. The equivalent payoff with Carr-Lee for a volatility swap is much more linear in the wings (not so far of a straddle).Arbitrage free SABR with negative rates - alternative to shifted SABR
https://chasethedevil.github.io/post/arbitrage-free-sabr-with-negative-rates---alternative-to-shifted-sabr/
Wed, 11 Mar 2015 18:48:00 +0000https://chasethedevil.github.io/post/arbitrage-free-sabr-with-negative-rates---alternative-to-shifted-sabr/Antonov et al. present an interesting view on SABR with negative rates: instead of relying on a shifted SABR to allow negative rates up to a somewhat arbitrary shift, they modify slightly the SABR model to allow negative rates directly: $$ dF_t = |F_t|^\beta v_t dW_F $$ with \\( v\_t \\) being the standard lognormal volatility process of SABR.
Furthermore they derive a clever semi-analytical approximation for this model, based on low correlation, quite close to the Monte-Carlo prices in their tests.Variance swaps on a foreign asset
https://chasethedevil.github.io/post/variance-swaps-on-a-foreign-asset/
Tue, 24 Feb 2015 13:50:00 +0000https://chasethedevil.github.io/post/variance-swaps-on-a-foreign-asset/There is very little information on variance swaps on a foreign asset. There can be two kinds of contracts:
one that pays the foreign variance in a domestic currency, this is a quanto contract as the exchange rate is implicitly fixed.one that pays the foreign variance, multiplied by the fx rate at maturity. This is a flexo contract, and is just about buying a variance swap from a foreign bank.Jumps impact: Variance swap vs volatility swap
https://chasethedevil.github.io/post/jumps-impact-variance-swap-vs-volatility-swap/
Fri, 20 Feb 2015 13:24:00 +0000https://chasethedevil.github.io/post/jumps-impact-variance-swap-vs-volatility-swap/Beside the problem with the discreteness of the replication, variance swaps are sensitive to jumps. This is an often mentioned reason for the collapse of the single name variance swap market in 2008 as jumps are more likely on single name equities.
Those graphs are the result of Monte-Carlo simulations with various jump sizes using the Bates model, and using Local Volatility implied from the Bates vanilla prices. The local volatility price will be the same price as per static replication for the variance swap, and we can see it they converge when there is no jump.Variance Swap Replication : Discrete or Continuous?
https://chasethedevil.github.io/post/variance-swap-replication--discrete-or-continuous/
Thu, 19 Feb 2015 18:45:00 +0000https://chasethedevil.github.io/post/variance-swap-replication--discrete-or-continuous/People regularly believe that Variance swaps need to be priced by discrete replication, because the market trades only a discrete set of options.
In reality, a discrete replication will misrepresent the tail, and can be quite arbitrary. It looks like the discrete replication as described in Derman Goldman Sachs paper is in everybody's mind, probably because it's easy to grasp. Strangely, it looks like most forget the section "Practical problems with replication"GTK 3.0 / Gnome 3.0 annoyance
https://chasethedevil.github.io/post/gtk-3.0--gnome-3.0-annoyance/
Sun, 08 Feb 2015 22:30:00 +0000https://chasethedevil.github.io/post/gtk-3.0--gnome-3.0-annoyance/It’s quite incredible that Gnome 3.0 was almost an identical mess as KDE 4.0 had been a year or two earlier. Both are much better now, more stable, but both also still have their issues, and don’t feel like a real improvement over Gnome 2.0 or KDE 3.5.
Now the main file manager for Gnome 3.0, Nautilus has buttons with nearly identical icons that mean vastly different things, one is a menu, the other is a list view.Monte Carlo & Inverse Cumulative Normal Distribution
https://chasethedevil.github.io/post/monte-carlo--inverse-cumulative-normal-distribution/
Tue, 03 Feb 2015 14:53:00 +0000https://chasethedevil.github.io/post/monte-carlo--inverse-cumulative-normal-distribution/In most financial Monte-Carlo simulations, there is the need of generating normally distributed random numbers. One technique is to use the inverse cumulative normal distribution function on uniform random numbers. There are several different popular numerical implementations:
Wichura AS241 (1988)Moro "The full Monte" (1995)Acklam (2004)Shaw breakless formula optimized for GPUs (2011) W. Shaw has an excellent overview of the accuracy of the various methods in his paper Refinement of the normal quantile.Local Stochastic Volatility - Particles and Bins
https://chasethedevil.github.io/post/local-stochastic-volatility---particles-and-bins/
Fri, 30 Jan 2015 12:03:00 +0000https://chasethedevil.github.io/post/local-stochastic-volatility---particles-and-bins/In an earlier post, I mentioned the similarities between the Guyon-Labordere particle method and the Vanderstoep-Grzelak-Oosterlee “bin” method to calibrate and price under Local Stochastic volatility. I will be a bit more precise here. The same thing, really
The particle method can be seen as a generalization of the “bin” method. In deed, the bin method consists in doing the particle method using a histogram estimation of the conditional variance. The histogram estimation can be more or less seen as a very basic rectangle kernel with the appropriate bandwidth.Flat Volatility Surfaces & Discrete Dividends
https://chasethedevil.github.io/post/flat-volatility-surfaces--discrete-dividends/
Tue, 25 Nov 2014 13:58:00 +0000https://chasethedevil.github.io/post/flat-volatility-surfaces--discrete-dividends/In papers around volatility and cash (discrete) dividends, we often encounter the example of the flat volatility surface. For example, the OpenGamma paper presents this graph:
It shows that if the Black volatility surface is fully flat, there are jumps in the pure volatility surface (corresponding to a process that includes discrete dividends in a consistent manner) at the dividend dates or equivalently if the pure volatility surface is flat, the Black volatility jumps.Machine Learning & Quantitative Finance
https://chasethedevil.github.io/post/machine-learning--quantitative-finance/
Tue, 18 Nov 2014 12:34:00 +0000https://chasethedevil.github.io/post/machine-learning--quantitative-finance/There is an interesting course on Machine Learning on Coursera, it does not require much knowledge and yet manages to teach quite a lot.
I was struck by the fact that most techniques and ideas apply also to problems in quantitative finance.
Linear regression: used for example in the Longstaff-Schwartz approach to price Bermudan options with Monte-Carlo. Interestingly the teacher insists on feature normalization, something we can forget easily, especially with the polynomial features.Pseudo-Random vs Quasi-Random Numbers
https://chasethedevil.github.io/post/pseudo-random-vs-quasi-random-numbers/
Wed, 12 Nov 2014 17:05:00 +0000https://chasethedevil.github.io/post/pseudo-random-vs-quasi-random-numbers/Quasi-Random numbers (like Sobol) are a relatively popular way in finance to improve the Monte-Carlo convergence compared to more classic Pseudo-Random numbers (like Mersenne-Twister). Behind the scenes one has to be a bit more careful about the dimension of the problem as the Quasi-Random numbers depends on the dimension (defined by how many random variables are independent from each other).
For a long time, Sobol was limited to 40 dimensions using the so called Bratley-Fox direction numbers (his paper actually gives the numbers for 50 dimensions).Integrating an oscillatory function
https://chasethedevil.github.io/post/integrating-an-oscillatory-function/
Wed, 05 Nov 2014 16:48:00 +0000https://chasethedevil.github.io/post/integrating-an-oscillatory-function/Recently, some instabilities were noticed in the Carr-Lee seasoned volatility swap price in some situations. The Carr-Lee seasoned volatility swap price involve the computation of a double integral. The inner integral is really the problematic one as the integrand can be highly oscillating.
I first found a somewhat stable behavior using a specific adaptive Gauss-Lobatto implementation (the one from Espelid) and a change of variable. But it was not very satisfying to see that the outer integral was stable only with another specific adaptive Gauss-Lobatto (the one from Gander & Gauschi, present in Quantlib).The elusive reference: the Lamperti transform
https://chasethedevil.github.io/post/the-elusive-reference-the-lamperti-transform/
Mon, 03 Nov 2014 11:23:00 +0000https://chasethedevil.github.io/post/the-elusive-reference-the-lamperti-transform/Without knowing that it was a well known general concept, I first noticed the use of the Lamperti transform in the Andersen-Piterbarg “Interest rate modeling” book p.292 “finite difference solutions for general phi”. Pat Hagan used that transformation for a better discretization of the arbitrage free SABR PDE model.I then started to notice the use of this transformation in many more papers. The first one I saw naming it “Lamperti transform” was the paper from Ait-Sahalia Maximum likelyhood estimation of discretely sampled diffusions: a closed-form approximation approach.Barrier options under negative rates: complex numbers to the rescue
https://chasethedevil.github.io/post/barrier-options-under-negative-rates-complex-numbers-to-the-rescue/
Thu, 02 Oct 2014 11:58:00 +0000https://chasethedevil.github.io/post/barrier-options-under-negative-rates-complex-numbers-to-the-rescue/I stumbled upon an unexpected problem: the one touch barrier formula can break down under negative rates. While negative rates can sound fancy, they are actually quite real on some markets. Combined with relatively low volatilities, this makes the standard Black-Scholes one touch barrier formula blow up because somewhere the square root of a negative number is taken.
At first, I had the idea to just floor the number to 0.Initial Guesses for SVI - A Summary
https://chasethedevil.github.io/post/initial-guesses-for-svi---a-summary/
Fri, 26 Sep 2014 10:46:00 +0000https://chasethedevil.github.io/post/initial-guesses-for-svi---a-summary/I have been looking at various ways of finding initial guesses for SVI calibration (Another SVI Initial Guess, More SVI Initial Guesses, SVI and long maturities issues). I decided to write a paper summarizing this. I find that the process of writing a paper makes me think more carefully about a problem.
In this case, it turns out that the Vogt initial guess method (guess via asymptotes and minimum variance) is actually very good as long as one has a good way to lookup the asymptotes (the data is not always convex, while SVI is) and as long as rho is not close to -1, that is for long maturity affine like smiles, where SVI is actually more difficult to calibrate properly due to the over-parameterisation in those cases.Asymptotic Behavior of SVI vs SABR
https://chasethedevil.github.io/post/asymptotic-behavior-of-svi-vs-sabr/
Tue, 23 Sep 2014 12:06:00 +0000https://chasethedevil.github.io/post/asymptotic-behavior-of-svi-vs-sabr/The variance under SVI becomes linear when the log-moneyness is very large in absolute terms. The lognormal SABR formula with beta=0 or beta=1 has a very different behavior. Of course, the theoretical SABR model has actually a different asymptotic behavior.
As an illustration, we calibrate SABR (with two different values of beta) and SVI against the same implied volatility slice and look at the wings behavior. While the Lee moments formula implies that the variance should be at most linear, something that the SABR formula does not respect.SVI and long maturities issues
https://chasethedevil.github.io/post/svi-and-long-maturities-issues/
Fri, 01 Aug 2014 12:51:00 +0000https://chasethedevil.github.io/post/svi-and-long-maturities-issues/On long maturities equity options, the smile is usually very much like a skew: very little curvature. This usually means that the SVI rho will be very close to -1, in a similar fashion as what can happen for the the correlation parameter of a real stochastic volatility model (Heston, SABR).
In terms of initial guess, I looked at the more usual use cases and showed that matching a parabola at the minimum variance point often leads to a decent initial guess if one has an ok estimate of the wings.More SVI Initial Guesses
https://chasethedevil.github.io/post/more-svi-initial-guesses/
Thu, 31 Jul 2014 14:54:00 +0000https://chasethedevil.github.io/post/more-svi-initial-guesses/In the previous post, I showed one could extract the SVI parameters from a best fit parabola at-the-money. It seemed to work reasonably well, but I found some real market data where it can be much less satisfying.
Sometimes (actually not so rarely) the ATM slope and curvatures can't be matched given rho and b found through the asymptotes. As a result if I force to just match the curvature and set m=0 (when the slope can't be matched), the simple ATM parabolic guess looks shifted.Another SVI Initial Guess
https://chasethedevil.github.io/post/another-svi-initial-guess/
Tue, 29 Jul 2014 14:39:00 +0000https://chasethedevil.github.io/post/another-svi-initial-guess/The SVI formula is:
$$w(k) = a + b ( \rho (k-m) + \sqrt{(k-m)^2+ \sigma^2}$$
where k is the log-moneyness, w(k) the implied variance at a given moneyness and a,b,rho,m,sigma the 5 SVI parameters.
A. Vogt described a particularly simple way to find an initial guess to fit SVI to an implied volatility slice a while ago. The idea to compute rho and sigma from the left and right asymptotic slopes.New SABR Formulae
https://chasethedevil.github.io/post/new-sabr-formulae/
Wed, 16 Jul 2014 22:35:00 +0000https://chasethedevil.github.io/post/new-sabr-formulae/In a talk at the Global Derivatives conference of Amsterdam (2014), Pat Hagan presented some new SABR formulas, supposedly close to the arbitrage free PDE behavior.
I tried to code those from the slides, but somehow that did not work out well on his example, I just had something very close to the good old SABR formulas. I am not 100% sure (only 99%) that it is due to a mistake in my code.Heston or Schobel-Zhu issues with short expiries
https://chasethedevil.github.io/post/heston-or-schobel-zhu-issues-with-short-expiries/
Thu, 03 Jul 2014 23:28:00 +0000https://chasethedevil.github.io/post/heston-or-schobel-zhu-issues-with-short-expiries/It's relatively well known that Heston does not fit the market for short expiries. Given that there are just 5 parameters to fit a full surface, it's almost logical that one part of the surface of it is not going to fit well the market.
I was more surprised to see how bad Heston or Schobel-Zhu were to fit a single short expiry volatility slice. As an example I looked at SP500 options with 1 week expiry.On the Role of Static Types and Generic Types on Productivity
https://chasethedevil.github.io/post/on-the-role-of-static-types-and-generic-types-on-productivity/
Sun, 29 Jun 2014 10:40:00 +0000https://chasethedevil.github.io/post/on-the-role-of-static-types-and-generic-types-on-productivity/Most developers have strong opinions on dynamic types programming languages vs static types programming languages. The former is often assumed to be good for small projects/prototyping while the later better for bigger projects. But there is a surprisingly small number of studies to back those claims.
One such study is "An experiment about static and dynamic type systems: doubts about the positive impact of static type systems on development time"Moore-Penrose Inverse & Gauss-Newton SABR Minimization
https://chasethedevil.github.io/post/moore-penrose-inverse--gauss-newton-sabr-minimization/
Tue, 24 Jun 2014 15:29:00 +0000https://chasethedevil.github.io/post/moore-penrose-inverse--gauss-newton-sabr-minimization/I have found a particularly nice initial guess to calibrate SABR. As it is quite close to the true best fit, it is tempting to use a very simple minimizer to go to the best fit. Levenberg-Marquardt works well on this problem, but can we shave off a few iterations?
I firstly considered the basic Newton's method, but for least squares minimization, the Hessian (second derivatives) is needed. It's possible to obtain it, even analytically with SABR, but it's quite annoying to derive it and code it without some automatic differentiation tool.One Interview Question for Job Seekers in Finance
https://chasethedevil.github.io/post/one-interview-question-for-job-seekers-in-finance/
Thu, 19 Jun 2014 21:51:00 +0000https://chasethedevil.github.io/post/one-interview-question-for-job-seekers-in-finance/I presented in an earlier post that I was mostly disillusioned with interview questions, it’s better to find out if you can learn something out of a candidate.Well there is maybe one very simple question that could be revealing, for people who pretend to be vaguely familiar with Black-Scholes:What is the price of an at-the-money binary option under very high volatility? Alternatively it can be asked with just an at-the-money european option under very high volatility.On the importance of accuracy for bpvol solvers
https://chasethedevil.github.io/post/on-the-importance-of-accuracy-for-bpvol-solvers/
Thu, 12 Jun 2014 17:31:00 +0000https://chasethedevil.github.io/post/on-the-importance-of-accuracy-for-bpvol-solvers/While I was playing around calibrating the arbitrage free SABR model from Hagan (using the PDE on probability density approach), I noticed a misbehavior for some short maturity smiles. I thought it was due to the PDE implementation. Actually some of it was, but the remaining large error was due to the bpvol solver.
I initially took the same approach as Choi et al. in my solver, that is to work with in-the-money prices (they work with straddles) because it’s nice and convenient.throws Exception
https://chasethedevil.github.io/post/throws-exception/
Tue, 27 May 2014 10:49:00 +0000https://chasethedevil.github.io/post/throws-exception/There was a big debate at work around Exception declaration in a Java API. I was quite surprised that such an apparently simple subject could end up being so controversial. The controversy was around the choice of declaring in the interfaces:
void myMethod() throws Exception
instead of
void myMethod() throws MyAPIException
void myMethod() throws MyAPIRuntimeException
void myMethod() where MyAPI represents either a generic API related exception or a specific exception related to the method in question.KDE, XFCE, Gnome-Shell in 2014
https://chasethedevil.github.io/post/kde-xfce-gnome-shell-in-2014/
Sun, 25 May 2014 09:26:00 +0000https://chasethedevil.github.io/post/kde-xfce-gnome-shell-in-2014/Many people (and notoriously, Linus Torvald) complained about Gnome-shell, especially the early iterations. Similarly KDE 4 was a nightmare of instability and inflexibility when it came out. And XFCE has always sounded a bit too basic. the moves of Gnome and KDE were particularly shocking as the earlier iteration: Gnome 2 and KDE 3 were well appreciated, productive environments.
Gnome Shell 3.10
It took me a bit of time to get used to it, and in the early stages I went to KDE 4 for a while, only to come back to it later.Two SABR for the same smile
https://chasethedevil.github.io/post/two-sabr-for-the-same-smile/
Tue, 20 May 2014 12:08:00 +0000https://chasethedevil.github.io/post/two-sabr-for-the-same-smile/While playing around with differential evolution to calibrate SABR, I noticed that sometimes, several set of parameters can lead to a very similar smile, usually the good one is for relatively low vol of vol and the bad one is for relatively high vol of vol. I first looked for errors in my implementation, but it’s a real phenomenon. I used the normal implied volatility formula with beta=1, then converted it to lognormal (Black) volatility.Heston vs SABR slice by slice fit
https://chasethedevil.github.io/post/heston-vs-sabr-slice-by-slice-fit/
Thu, 15 May 2014 22:06:00 +0000https://chasethedevil.github.io/post/heston-vs-sabr-slice-by-slice-fit/Some people use Heston to fit one slice of a volatility surface. In this case, some parameters are clearly redundant. Still, I was wondering how it fared against SABR, which is always used to fit a slice. And what about Schobel-Zhu? Aggregated error in fit per slice on 10 surfaces With Heston, the calibration is actually slightly better with kappa=0, that is, without mean reversion, because the global optimization is easier and the mean reversion is fully redundant.Quadratic Spline with Knots at Mid-Points
https://chasethedevil.github.io/post/quadratic-spline-with-knots-at-mid-points/
Wed, 14 May 2014 14:12:00 +0000https://chasethedevil.github.io/post/quadratic-spline-with-knots-at-mid-points/Two months ago, I looked at arbitrage free interpolation using piecewise-constant density. This is equivalent to a piecewise quadratic polynomial in call prices where each piece is centered around each call strike.
I wondered at the time what a quadratic spline would look like on this problem, as it should be very close in theory, except that we can ensure that it is C1, a condition for a good looking implied volatility.On Interviewing Candidates for a Job
https://chasethedevil.github.io/post/on-interviewing-candidates-for-a-job/
Wed, 23 Apr 2014 17:18:00 +0000https://chasethedevil.github.io/post/on-interviewing-candidates-for-a-job/I am going to write a little about my experience and conclusions so far around interviewing a candidate for a software developer position or for a quant position, but it should be quite general.
At first, I used to ask interview questions I liked when I was myself a candidate. On the technical side, it would stuff like:
which design patterns do you know? what’s your opinion on design patterns?< what’s a virtual method?Non-linear Option Pricing
https://chasethedevil.github.io/post/non-linear-option-pricing/
Fri, 18 Apr 2014 22:18:00 +0000https://chasethedevil.github.io/post/non-linear-option-pricing/I am currently reading the book “Nonlinear Option Pricing” by J. Guyon and P. Henry-Labordère. It’s quite interesting even if the first third is quite theoretical. For example they describe how to solve some not well defined non-linear parabolic PDE by relying on the parabolic envelope. They also explain why most problems lead to parabolic PDEs in finance.
The rest is a bit more practical. I stumbled upon an good remark regarding Longstaff-Schwartz: the algorithm as Longstaff and Schwarz describe it does not necessary lead to a low-biased estimate as they use future information (the paths they regress on) in the Monte-Carlo estimate.5 Minutes of Xtend
https://chasethedevil.github.io/post/5-minutes-of-xtend/
Tue, 08 Apr 2014 17:37:00 +0000https://chasethedevil.github.io/post/5-minutes-of-xtend/There is a relatively new JVM based language, Xtend. Their homepage says “JAVA 10, TODAY!”, so I thought I would give it a try, I was especially interested in operator overloading support, and the fact that it compiles to Java code, not Java byte code.
Unfortunately, after 5 minutes with it, and pasting some non Java code in an xtend file, Eclipse hangs forever, even on restart. After creating another workspace, just to trash the new workspace a similar way.Building a more accurate basis point volatility formula
https://chasethedevil.github.io/post/building-a-more-accurate-basis-point-volatility-formula/
Sat, 05 Apr 2014 15:42:00 +0000https://chasethedevil.github.io/post/building-a-more-accurate-basis-point-volatility-formula/P. Jaeckel has defied the limits of accuracy with his latest Black-Scholes volatility solver, managing to also improve performance compared to his earlier solver "By Implication". Out of a silly exercise, I decided to try my hand for a more accurate Normal (or basis point) volatility solver.
In reality, the problem is much simpler in the Bachelier/Normal model. A very basic analysis of Bachelier formula shows that the problem can be reduced to a single variable, as Choi et al explain in their paper.Fast and Accurate Implied Volatility Solver
https://chasethedevil.github.io/post/fast-and-accurate-implied-volatility-solver/
Wed, 19 Mar 2014 18:10:00 +0000https://chasethedevil.github.io/post/fast-and-accurate-implied-volatility-solver/The calibration of a stochastic volatility model or a volatility surface parameterization (like SVI) involves minimizing the model options volatilities against market options volatilities. Often, the model computes an option price, not an implied volatility. It is therefore useful to have a fast way to invert that option price to get back the implied volatility that corresponds to it. Furthermore during the calibration procedure, the model option price can vary widely: it is convenient to have a robust implied volatility solver.Arbitrage Free Interpolation of Option Prices using Piecewise Constant Density
https://chasethedevil.github.io/post/arbitrage-free-interpolation-of-option-prices-using-piecewise-constant-density/
Mon, 17 Mar 2014 15:25:00 +0000https://chasethedevil.github.io/post/arbitrage-free-interpolation-of-option-prices-using-piecewise-constant-density/Tension splines can produce in some cases arbitrage free C2 interpolation of options, but unfortunately this is not guaranteed. It turns out that, on some not so nice looking data, where the discrete probability density is not monotone but only positive, all previously considered interpolation fail (spline in volatility or variance, tension spline in log prices, harmonic spline on prices).K vol put b-slope b-convexity300.0 0.682 0.090 0.00e+00 0.00e+00310.0 0.654 0.136 4.C2 Arbitrage Free Interpolation with Tension Splines
https://chasethedevil.github.io/post/c2-arbitrage-free-interpolation-with-tension-splines/
Tue, 11 Mar 2014 17:05:00 +0000https://chasethedevil.github.io/post/c2-arbitrage-free-interpolation-with-tension-splines/In a previous post, I have explored the arbitrage free wiggles in the volatility surface that P. Jaeckel found in his paper. I showed that interpolating in log prices instead of prices was enough to remove the wiggles, but then, it appears that the interpolation is not guaranteed to be arbitrage free, even though it often is. On another example from P. Jaeckel paper, that I reproduced inaccurately but well enough, it is not.Bachelier and Black-Scholes Fits of the Volatility Surface, what about SABR?
https://chasethedevil.github.io/post/bachelier-and-black-scholes-fits-of-the-volatility-surface-what-about-sabr/
Fri, 07 Mar 2014 15:31:00 +0000https://chasethedevil.github.io/post/bachelier-and-black-scholes-fits-of-the-volatility-surface-what-about-sabr/I always wondered if Bachelier was really worse than Black-Scholes in practice. As an experiment I fit various implied volatility surfaces with Bachelier and Black-Scholes and look at the average error in implied volatility by slice.
In theory Bachelier is appealing because slightly simpler: log returns are a bit more challenging to think about than returns. And it also takes indirectly into account the fact that OTM calls are less likely than OTM puts because of default risk, if you assume absorbing probability at strike 0.Arbitrage Free Wiggles
https://chasethedevil.github.io/post/arbitrage-free-wiggles/
Mon, 03 Mar 2014 17:13:00 +0000https://chasethedevil.github.io/post/arbitrage-free-wiggles/Peter Jaeckel, in a recent paper (pdf), shows that something that sounds like a reasonable arbitrage free interpolation can produce wiggles in the implied volatility slice.
The interpolation in question is using some convexity preserving spline on call and put option prices directly and in strike, assuming those input prices are arbitrage free. This is very similar to Kahale interpolation (pdf).
It seemed too crazy for me so I had to try out his example.Adjoint Delta for Monte-Carlo
https://chasethedevil.github.io/post/adjoint-delta-for-monte-carlo/
Tue, 25 Feb 2014 18:37:00 +0000https://chasethedevil.github.io/post/adjoint-delta-for-monte-carlo/In an earlier post, I have been quickly exploring adjoint differentiation in the context of analytical Black-Scholes. Today, I tried to mix it in a simple Black-Scholes Monte-Carlo as described in L. Capriotti paper, and measured the performance to compute delta compared to a numerical single sided finite difference delta.I was a bit surprised that even on a single underlying, without any real optimization, adjoint delta was faster by a factor of nearly 40%.SVI on top of SABR
https://chasethedevil.github.io/post/svi-on-top-of-sabr/
Thu, 20 Feb 2014 18:36:00 +0000https://chasethedevil.github.io/post/svi-on-top-of-sabr/Several papers show that the limit for large strikes of Heston is SVI.
Interestingly, I stumbled onto a surface where the Hagan SABR fit was perfect as well as the SVI fit, while the Heston fit was not.
Originally, I knew that, on this data, the SVI fit was perfect. Until today, I just never tried to fit a lognormal SABR on the same data. I did a small test with random values of the SABR parameters alpha, rho, nu, and found out that in deed, the SVI fit is always perfect on SABR.Smart Initial Guess for Schobel-Zhu
https://chasethedevil.github.io/post/smart-initial-guess-for-schobel-zhu/
Wed, 19 Feb 2014 18:57:00 +0000https://chasethedevil.github.io/post/smart-initial-guess-for-schobel-zhu/With a small time expansion, it is easy to derive a reasonable initial guess, without resorting to some global minimizer.
Like Forde did for Heston, one can find the 5 Schobel-Zhu parameters through 5 points at coordinates (0,0), (x0,t1), (-x0,t1), (x0,t2), (-x0,t2), where x0 is a chosen the log-moneyness, for example, 0.1 and t1, t2 relatively short expiries (for example, 0.1, 0.25).
We can truncate the small time expansion so that the polynomial in (x,t) is fully captured by those 5 points.A Look at Small Time Expansions for Heston
https://chasethedevil.github.io/post/a-look-at-small-time-expansions-for-heston/
Wed, 12 Feb 2014 13:13:00 +0000https://chasethedevil.github.io/post/a-look-at-small-time-expansions-for-heston/Small time expansions for Heston can be useful during the calibration of the implied volatility surface, in order to find an initial guess for a local minimizer (for example, Levenberg-Marquardt). Even if they are not so accurate, they capture the dynamic of the model parameters, and that is often enough.
In 2011, Forde et al. proposed a second order small time expansion around the money, which I found to work well for calibration.A Small-Time Schobel-Zhu Expansion
https://chasethedevil.github.io/post/a-small-time-schobel-zhu-expansion/
Mon, 10 Feb 2014 18:30:00 +0000https://chasethedevil.github.io/post/a-small-time-schobel-zhu-expansion/The paper implied vol for any local stochastic vol model from Lorig et al. presents a very generic and simple formula to compute implied volatility expansions up to order-2 (there is actually an order-3 formula available in their Mathematica CDF file).
I tried it on the Schobel-Zhu stochastic volatility model. This model is an interesting alternative to Heston. I found that, in practice, the implied volatility surface fit was as good, while the simulation under the QE scheme is quite faster (and simpler) than Heston.An SSD instead of a laptop
https://chasethedevil.github.io/post/an-ssd-instead-of-a-laptop/
Tue, 04 Feb 2014 15:45:00 +0000https://chasethedevil.github.io/post/an-ssd-instead-of-a-laptop/Last week, my work laptop died after spilling out some water on its keyboard inadvertently. Fortunately, its SSD was intact.
As the laptop SSD connector (SATA) and power follow the desktop computers standards, and as I use Linux, I just plugged the SSD to my home desktop and booted off the SSD. I had to change slightly the X configuration but otherwise everything worked. Linux is great for that
The same way, I just plugged the SSD to the desktop at work and it worked.Brownian Bridge or Not with Heston Quadratic Exponential QMC
https://chasethedevil.github.io/post/brownian-bridge-or-not-with-heston-quadratic-exponential-qmc/
Fri, 24 Jan 2014 19:35:00 +0000https://chasethedevil.github.io/post/brownian-bridge-or-not-with-heston-quadratic-exponential-qmc/At first I did not make use of the Brownian Bridge technique in Heston QMC, because the variance process is not simulated like a Brownian Motion under the Quadratic Exponential algorithm from Andersen.
It is, however, perfectly possible to use the Brownian Bridge on the asset process. Does it make a difference? In my small test, it does not seem to make a difference. An additional question would be, is it better to take first N for the asset and next N for the variance or vice versa or intertwined?Adjoint Algorithmic Differentiation for Black-Scholes
https://chasethedevil.github.io/post/adjoint-algorithmic-differentiation-for-black-scholes/
Tue, 21 Jan 2014 13:03:00 +0000https://chasethedevil.github.io/post/adjoint-algorithmic-differentiation-for-black-scholes/Adjoint algorithmic differentiation is particularly interesting in finance as we often encounter the case of a function that takes many input (the market data) and returns one output (the price) and we would like to also compute sensitivities (greeks) to each input.
As I am just starting around it, to get a better grasp, I first tried to apply the idea to the analytic knock out barrier option formula, by hand, only to find out I was making way too many errors by hand to verify anything.Placing the Strike on the Grid and Payoff Smoothing in Finite Difference Methods for Vanilla Options
https://chasethedevil.github.io/post/placing-the-strike-on-the-grid-and-payoff-smoothing-in-finite-difference-methods-for-vanilla-options/
Sun, 12 Jan 2014 16:27:00 +0000https://chasethedevil.github.io/post/placing-the-strike-on-the-grid-and-payoff-smoothing-in-finite-difference-methods-for-vanilla-options/Pooley et al., in Convergence Remedies for non-smooth payoffs in option pricing suggest that placing the strike on the grid for a Vanilla option is good enough:
At the same time, Tavella and Randall show in their book that numerically, placing the strike in the middle of two nodes leads to a more accurate result. My own numerical experiments confirm Tavella and Randall suggestion.
In reality, what Pooley et al.Coordinate Transform of the Andreasen Huge SABR PDE & Spline Interpolation
https://chasethedevil.github.io/post/coordinate-transform-of-the-andreasen-huge-sabr-pde--spline-interpolation/
Wed, 08 Jan 2014 18:51:00 +0000https://chasethedevil.github.io/post/coordinate-transform-of-the-andreasen-huge-sabr-pde--spline-interpolation/Recently, I noticed how close are the two PDE based approaches from Andreasen-Huge and Hagan for an arbitrage free SABR. Hagan gives a local volatility very close to the one Andreasen-Huge use in the forward PDE in call prices. A multistep Andreasen-Huge (instead of their one step PDE method) gives back prices and densities nearly equal to Hagan density based approach.
Hagan proposed in some unpublished paper a coordinate transformation for two reasons: the ideal range of strikes for the PDE can be very large, and concentrating the points where it matters should improve stability and accuracy.Random Hardware Issues
https://chasethedevil.github.io/post/random-hardware-issues/
Mon, 06 Jan 2014 18:44:00 +0000https://chasethedevil.github.io/post/random-hardware-issues/Today, after wondering why my desktop computer became so unstable (frequent crashes under Fedora), I found out that the micro usb port of my cell phone has some kind of short circuit. My phone behaves strangely in 2014, it lasted nearly 1 week on battery (I lost it for half of the week), and seems to shutdown for no particular reason once in a while.
On the positive side, I also discovered, after owning my monitor for around 5 years, that it has SD card slots on the side, as well as USB ports.Levenberg Marquardt & Constraints by Domain Transformation
https://chasethedevil.github.io/post/levenberg-marquardt--constraints-by-domain-transformation/
Tue, 17 Dec 2013 15:27:00 +0000https://chasethedevil.github.io/post/levenberg-marquardt--constraints-by-domain-transformation/The Fortran minpack library has a good Levenberg-Marquardt minimizer, so good, that it has been ported to many programming languages. Unfortunately it does not support contraints, even simple bounds.
One way to achieve this is to transform the domain via a bijective function. For example, \(a+\frac{b-a}{1+e^{-\alpha t}}\) will transform \(]-\infty, +\infty[\) to ]a,b[. Then how should one choose \(\alpha\)?
A large \(\alpha\) will make tiny changes in \(t\) appear large.Arbitrage Free SABR - Another View on Hagan Approach
https://chasethedevil.github.io/post/arbitrage-free-sabr---another-view-on-hagan-approach/
Sat, 14 Dec 2013 00:56:00 +0000https://chasethedevil.github.io/post/arbitrage-free-sabr---another-view-on-hagan-approach/Several months ago, I took a look at two interesting recent ways to price under SABR with no arbitrage:
One way is due to Andreasen and Huge, where they find an equivalent local volatility expansion, and then use a one-step finite difference technique to price. The other way is due to Hagan himself, where he numerically solves an approximate PDE in the probability density, and then price with options by integrating on this density.American Option on Forward/Futures
https://chasethedevil.github.io/post/american-option-on-forwardfutures/
Thu, 21 Nov 2013 11:17:00 +0000https://chasethedevil.github.io/post/american-option-on-forwardfutures/Prices of a Future contract and a Forward contract are the same under the Black-Scholes assumptions (deterministic rates) but the price of options on Futures or options on Forwards might still differ. I did not find this obvious at first.
For example, when the underlying contract expiration date (Futures, Forward) is different from the option expiration date. For a Future Option, the Black-76 formula can be used, the discounting is done from the option expiry date, because one receives the cash on expiration due to the margin account.Spikes in Heston/Schobel-Zhu Local Volatility
https://chasethedevil.github.io/post/spikes-in-hestonschobel-zhu-local-volatility/
Wed, 20 Nov 2013 13:33:00 +0000https://chasethedevil.github.io/post/spikes-in-hestonschobel-zhu-local-volatility/Using precise vanilla option pricing engine for Heston or Schobel-Zhu, like the Cos method with enough points and a large enough truncation can still lead to spikes in the Dupire local volatility (using the variance based formula).
Local volatility Implied volatility The large spikes in the local volatility 3d surface are due to constant extrapolation, but there are spikes even way before the extrapolation takes place at longer maturities. Even if the Cos method is precise, it seems to be not enough, especially for large strikes so that the second derivative over the strike combined with the first derivative over time can strongly oscillate.Local Stochastic Volatility with Monte-Carlo
https://chasethedevil.github.io/post/local-stochastic-volatility-with-monte-carlo/
Wed, 16 Oct 2013 16:14:00 +0000https://chasethedevil.github.io/post/local-stochastic-volatility-with-monte-carlo/I always imagined local stochastic volatility to be complicated, and thought it would be very slow to calibrate.
After reading a bit about it, I noticed that the calibration phase could just consist in calibrating independently a Dupire local volatility model and a stochastic volatility model the usual way.
One can then choose to compute on the fly the local volatility component (not equal the Dupire one, but including the stochastic adjustment) in the Monte-Carlo simulation to price a product.Heston, Schobel-Zhu, Bates, Double-Heston Fit
https://chasethedevil.github.io/post/heston-schobel-zhu-bates-double-heston-fit/
Mon, 07 Oct 2013 19:35:00 +0000https://chasethedevil.github.io/post/heston-schobel-zhu-bates-double-heston-fit/I did some experiments fitting Heston, Schobel-Zhu, Bates and Double-Heston to a real world equity index implied volatility surface. I used a global optimizer (differential evolution).
To my surprise, the Heston fit is quite good: the implied volatility error is less than 0.42% on average. Schobel-Zhu fit is also good (0.47% RMSE), but a bit worse than Heston. Bates improves quite a bit on Heston although it has 3 more parameters, we can see the fit is better for short maturities (0.Second Cumulant of Heston
https://chasethedevil.github.io/post/second-cumulant-of-heston/
Thu, 03 Oct 2013 17:27:00 +0000https://chasethedevil.github.io/post/second-cumulant-of-heston/I recently stumbled upon an error in the various papers related to the Heston Cos method regarding the second cumulant. It is used to define the boundaries of the Cos method. Letting phi be Heston characteristic function, the cumulant generating function is: $$g(u) = \log(\phi(-iu))$$
And the second cumulant is defined a: $$c_2 = g’’(0)$$Compared to a numerical implementation, the c_2 from the paper is really off in many use cases.Maxima for Symbolic Calculus
https://chasethedevil.github.io/post/maxima-for-symbolic-calculus/
Wed, 02 Oct 2013 15:06:00 +0000https://chasethedevil.github.io/post/maxima-for-symbolic-calculus/A few years ago, I found an interesting open source symbolic calculus software called Xcas. It can however be quickly limited, for example, it does not seem to work well to compute Taylor expansions with several embedded functions. Google pointed me to another popular open source package, Maxima. It looks a bit rudimentary (command like interface), but formulas can actually be very easily exported to latex with the tex command. Here is a simple example:Martin Odersky teaches Scala to the Masses
https://chasethedevil.github.io/post/martin-odersky-teaches-scala-to-the-masses/
Tue, 17 Sep 2013 20:11:00 +0000https://chasethedevil.github.io/post/martin-odersky-teaches-scala-to-the-masses/I tried today the Scala courses on coursera by the Scala creator, Martin Odersky. I was quite impressed by the quality: I somehow believed Scala to be only a better Java, now I think otherwise. Throughout the course, even though it all sounds very basic, you understand the key concepts of Scala and why functional programming + OO concepts are a natural idea. What’s nice about Scala is that it avoids the functional vs OO or even the functional vs procedural debate by allowing both, because both can be important, at different scales.Setting Values in Java Enum - A Bad Idea
https://chasethedevil.github.io/post/setting-values-in-java-enum---a-bad-idea/
Thu, 12 Sep 2013 10:06:00 +0000https://chasethedevil.github.io/post/setting-values-in-java-enum---a-bad-idea/My Scala habits have made me create a stupid bug related to Java enums. In Scala, the concept of case classes is very neat and recently, I just confused enum in Java with what I sometimes do in Scala case classes.
I wrote an enum with a setter like:
public static enum BlackVariateType {
V0,
ZERO_DERIVATIVE;
private double volSquare;
public double getBlackVolatilitySquare() {
return volSquare;Making Classic Heston Integration Faster than the Cos Method
https://chasethedevil.github.io/post/making-classic-heston-integration-faster-than-the-cos-method/
Thu, 05 Sep 2013 17:35:00 +0000https://chasethedevil.github.io/post/making-classic-heston-integration-faster-than-the-cos-method/A coworker pointed to me that Andersen and Piterbarg book “Interest Rate Modeling” had a chapter on Fourier integration applied to Heston. The authors rely on the Lewis formula to price vanilla call options under Heston. Lewis formula More importantly, they strongly advise the use of a Black-Scholes control variate. I had read about that idea before, and actually tried it in the Cos method, but it did not improve anything for the Cos method.Better Fonts in Fedora than in Ubuntu
https://chasethedevil.github.io/post/better-fonts-in-fedora-than-in-ubuntu/
Sat, 31 Aug 2013 13:36:00 +0000https://chasethedevil.github.io/post/better-fonts-in-fedora-than-in-ubuntu/By default, text in Fedora 19 looks ok but not great. There are good tips to improve fonts on http://fedorasolved.org/Members/khaytsus/improve-fonts As root user here is what need to be done: cd /etc/fonts/conf.dln -s /usr/share/fontconfig/conf.avail/10-autohint.confln -s /usr/share/fontconfig/conf.avail/11-lcdfilter-default.confyum install freetype-freeworld Reboot, then, in gnome-tweak-tool choose hinting = slight, and antialiasing = rgba. I also choose the liberation sans and liberation mono fonts.
I am not sure which one did the trick, but it looks much better (even better than my laptop under Ubuntu, not sure why).Attari, Lord-Kahl & Cos Methods Comparison on Heston
https://chasethedevil.github.io/post/attari-lord-kahl--cos-methods-comparison-on-heston/
Wed, 28 Aug 2013 17:54:00 +0000https://chasethedevil.github.io/post/attari-lord-kahl--cos-methods-comparison-on-heston/I recently wrote about the Cos method. While rereading the various papers on Heston semi-analytical pricing, especially the nice summary by Schmelzle, it struck me how close were the Attari/Bates methods and the Cos method derivations. I then started wondering if Attari was really much worse than the Cos method or not.
I noticed that Attari method accuracy is directly linked to the underlying Gaussian quadrature method accuracy. I found that the doubly adaptive Newton-Cotes quadrature by Espelid (coteda) was the most accurate/fastest on this problem (compared to Gauss-Laguerre/Legendre/Extrapolated Simpson/Lobatto).Giving Fedora Another Chance
https://chasethedevil.github.io/post/giving-fedora-another-chance/
Wed, 14 Aug 2013 22:15:00 +0000https://chasethedevil.github.io/post/giving-fedora-another-chance/I have had some stability issues with the Ubuntu 13.04 on my home computer, not on my laptop. It might be related to hard disk encryption (out of curiosity I encrypted my main hard drive in the installer option, resulting in a usable but quite slow system - it’s incredible how much the hard drive is still important for performance). I did not have any particular issue on my work laptop with it.Julia and the Cumulative Normal Distribution
https://chasethedevil.github.io/post/julia-and-the-cumulative-normal-distribution/
Tue, 13 Aug 2013 15:52:00 +0000https://chasethedevil.github.io/post/julia-and-the-cumulative-normal-distribution/I just stumbled upon Julia, a new programming language aimed at numerical computation. It’s quite new but it looks very interesting, with the promise of C like performance (thanks to LLVM compilation) with a much nicer syntax and parallelization features.Out of curiosity, I looked at their cumulative normal distribution implementation. I found that the (complimentary) error function (directly related to the cumulative normal distribution) algorithm relies on an algorithm that can be found in the Faddeeva library.The COS method for Heston
https://chasethedevil.github.io/post/the-cos-method-for-heston/
Fri, 02 Aug 2013 14:19:00 +0000https://chasethedevil.github.io/post/the-cos-method-for-heston/Fang, in her thesis, has the idea of the COS method and applies it to Heston. There are several published papers around it to price options under various models that have a known characteristic function, as well as to price more exotic options like barriers or bermudans.
The COS method is very close to the more standard Heston quasi analytic formula (use transform of characteristic function for the density and integrates the payoff with the density, exchanging summation), except that the more simple Fourier series are used instead of the standard Fourier transform.Octave vs Scilab for PDEs in Finance
https://chasethedevil.github.io/post/octave-vs-scilab-for-pdes-in-finance/
Tue, 30 Jul 2013 12:10:00 +0000https://chasethedevil.github.io/post/octave-vs-scilab-for-pdes-in-finance/I was used to Scilab for small experiments involving linear algebra. I also like some of Scilab choices in algorithms: for example it provides PCHIM monotonic spline algorithm, and uses Cody for the cumulative normal distribution.
Matlab like software is particularly well suited to express PDE solvers in a relatively concise manner. To illustrate some of my experiments, I started to write a Scilab script for the Arbitrage Free SABR problem.Joda LocalDateTime vs DateTime
https://chasethedevil.github.io/post/joda-localdatetime-vs-datetime/
Wed, 17 Jul 2013 14:11:00 +0000https://chasethedevil.github.io/post/joda-localdatetime-vs-datetime/Joda has the concept of LocalDate LocalDateTime and DateTime. The LocalDate is just a simple date, while DateTime is a date and a time zone.
Where I work we have a similar distinction, although not the same: a simple “absolute” date object without time vs a relative date (a timestamp) like the JDK Date.
The standard JDK Date class is a date without a time zone, but Sun deprecated in JDK 1.The CUDA Performance Myth II
https://chasethedevil.github.io/post/the-cuda-performance-myth-ii/
Fri, 12 Jul 2013 15:23:00 +0000https://chasethedevil.github.io/post/the-cuda-performance-myth-ii/This is a kind of following to the CUDA performance myth. There is a recent news on the java concurrent mailing list about SplittableRandom class proposed for JDK8. It is a new parallel random number generator a priori usable for Monte-Carlo simulations.
It seems to rely on some very recent algorithm. There are some a bit older ones: the ancestor, L’Ecuyer MRG32k3a that can be parallelized through relatively costless skipTo methods, a Mersenne Twister variant MTGP, and even the less rigourous XorWow popularized by NVidia CUDA.Unity vs KDE in Virtualbox
https://chasethedevil.github.io/post/unity-vs-kde-in-virtualbox/
Wed, 10 Jul 2013 23:17:00 +0000https://chasethedevil.github.io/post/unity-vs-kde-in-virtualbox/The other day I installed the latest Ubuntu 13.04 under a VirtualBox virtual machine using Windows as host. To my surprise, unity failed to launch properly on the virtual machine reboot, with compiz complaining, something I have sometimes seen on my work laptop. It’s more surprising in a VM since it is in a way much more standard (no strange graphic card, no strange driver, the same stuff for every VirtualBox user (maybe I’m wrong there?Bessel and Harmonic Kinks in the Forward
https://chasethedevil.github.io/post/bessel-and-harmonic-kinks-in-the-forward/
Tue, 02 Jul 2013 15:44:00 +0000https://chasethedevil.github.io/post/bessel-and-harmonic-kinks-in-the-forward/As Bessel (sometimes called Hermite) spline interpolation is only C1, like the Harmonic spline from Fritsch-Butland, the forward presents small kinks compared to a standard cubic spline. Hyman filtering also creates a kink where it fixes the monotonicity. Those are especially visible with a log scale in time. Here is how it looks on the Hagan-West difficult curve.Godaddy sold my domain name
https://chasethedevil.github.io/post/godaddy-sold-my-domain-name/
Mon, 24 Jun 2013 19:11:00 +0000https://chasethedevil.github.io/post/godaddy-sold-my-domain-name/I discovered that suddenly emails sent to me bounced back yesterday. I logged in my godaddy account and to my surprise saw that I did not own any domain name anymore. I looked at my emails to see if I had received a warning as is usually the case when your domain is about to expire. There was none recent, the most recent was from may 2011, the last time I had renewed my domain.Scala Build Tool : SBT
https://chasethedevil.github.io/post/scala-build-tool--sbt/
Wed, 19 Jun 2013 18:01:00 +0000https://chasethedevil.github.io/post/scala-build-tool--sbt/It’s been a while since I do a pet project in Scala, and today, after many trials before, I decided to give another go at Jetbrain Idea for Scala development, as Eclipse with the Scala plugin tended to crash a little bit too often for my taste (resulting sometimes in loss of a few lines of code). I could have just probably updated eclipse and the scala plugin, mine were not very old, but not the latest.The Finite Difference Theta Scheme Optimal Theta
https://chasethedevil.github.io/post/the-finite-difference-theta-scheme-optimal-theta/
Tue, 18 Jun 2013 15:02:00 +0000https://chasethedevil.github.io/post/the-finite-difference-theta-scheme-optimal-theta/The theta finite difference scheme is a common generalization of Crank-Nicolson. In finance, the book from Wilmott, a paper from A. Sepp, one from Andersen-Ratcliffe present it. Most of the time, it’s just a convenient way to handle implicit \(\theta=1\), explicit \(\theta=0\) and Crank-Nicolson \(\theta=0.5\) with the same algorithm.
Wilmott makes an interesting remark: one can choose a theta that will cancel out higher order terms in the local truncation error and therefore should lead to increased accuracy.Simple 'Can Scala Do This?' Questions
https://chasethedevil.github.io/post/simple-can-scala-do-this-questions/
Tue, 11 Jun 2013 00:28:00 +0000https://chasethedevil.github.io/post/simple-can-scala-do-this-questions/Today, a friend asked me if Scala could pass primitives (such as Double) by reference. It can be useful sometimes instead of creating a full blown object. In Java there is commons lang MutableDouble. It could be interesting if there was some optimized way to do that.
One answer could be: it’s not functional programming oriented and therefore not too surprising this is not encouraged in Scala.
Then he wondered if we could use it for C#.Akima for Yield Curve Interpolation ?
https://chasethedevil.github.io/post/akima-for-yield-curve-interpolation-/
Mon, 03 Jun 2013 00:07:00 +0000https://chasethedevil.github.io/post/akima-for-yield-curve-interpolation-/On my test of yield curve interpolations, focusing on parallel delta versus sequential delta, Akima is the worst of the lot. I am not sure why this interpolation is still popular when most alternatives seem much better. Hyman presented some of the issues with Akima in his paper in 1983. In the following graph, a higher value is a higher parallel-vs-sequential difference. That plus the Hagan-West example of a tricky curve looks a bit convoluted with it (although it does not have any negative forward).2 Ways for an Accurate Barrier with Finite Difference
https://chasethedevil.github.io/post/2-ways-for-an-accurate-barrier-with-finite-difference/
Sun, 02 Jun 2013 00:46:00 +0000https://chasethedevil.github.io/post/2-ways-for-an-accurate-barrier-with-finite-difference/I had explored the issue of pricing a barrier using finite difference discretization of the Black-Scholes PDE a few years ago. Briefly, for explicit schemes, one just need to place the barrier on the grid and not worry about much else, but for implicit schemes, either the barrier should be placed on the grid and the grid truncated at the barrier, or a fictitious point should be introduced to force the correct price at the barrier level (0, typically).SABR with the new Hagan PDE Approach
https://chasethedevil.github.io/post/sabr-with-the-new-hagan-pde-approach/
Tue, 28 May 2013 15:56:00 +0000https://chasethedevil.github.io/post/sabr-with-the-new-hagan-pde-approach/At a presentation of the Thalesians, Hagan has presented a new PDE based approach to compute arbitrage free prices under SABR. This is similar in spirit as Andreasen-Huge, but the PDE is directly on the density, not on the prices, and there is no one-step procedure: it's just like a regular PDE with proper boundary conditions.
I was wondering how it compared to Andreasen Huge results.
My first implementation was quite slow.SABR with Andreasen-Huge
https://chasethedevil.github.io/post/sabr-with-andreasen-huge/
Fri, 24 May 2013 14:17:00 +0000https://chasethedevil.github.io/post/sabr-with-andreasen-huge/I am on holiday today. Unfortunately I am still thinking about work-related matters, and out of curiosity, wanted to do a little experiment. I know it is not very good to spend free time on work related stuff: there is no reward for it, and there is so much more to life. Hopefully it will be over after this post.
Around 2 years ago, I saw a presentation from Andreasen and Huge about how they were able to price/calibrate SABR by a one-step finite difference technique.Large Steps in Schobel-Zhu/Heston the Lazy Way
https://chasethedevil.github.io/post/large-steps-in-schobel-zhuheston-the-lazy-way/
Fri, 17 May 2013 12:46:00 +0000https://chasethedevil.github.io/post/large-steps-in-schobel-zhuheston-the-lazy-way/Van Haastrecht, Lord and Pelsser present an effective way to price derivatives by Monte-Carlo under the Schobel-Zhu model (as well as under the Schobel-Zhu-Hull-White model). It's quite similar to Andersen QE scheme for Heston in spirit.
In their paper they evolve the (log) asset process together with the volatility process, using the same discretization times. A while ago, when looking at Joshi and Chan large steps for Heston, I noticed that, inspired by Broadie-Kaya exact Heston scheme, they present the idea to evolve the variance process using small steps and the asset process using large steps (depending on the payoff) using the integrated variance value computed by small steps.Exact Forward in Monte-Carlo
https://chasethedevil.github.io/post/exact-forward-in-monte-carlo/
Mon, 13 May 2013 17:58:00 +0000https://chasethedevil.github.io/post/exact-forward-in-monte-carlo/Where I work, there used to be quite a bit of a confusion on which rates one should use as input to a Local Volatility Monte-Carlo simulation.
In particular there is a paper in the Journal of Computation Finance by Andersen and Ratcliffe “The Equity Option Volatility Smile: a Finite Difference Approach” which explains one should use specially tailored rates for the finite difference scheme in order to reproduce exact Bond price and exact Forward contract pricesQuasi Monte Carlo in Finance
https://chasethedevil.github.io/post/quasi-monte-carlo-in-finance/
Mon, 13 May 2013 13:16:00 +0000https://chasethedevil.github.io/post/quasi-monte-carlo-in-finance/I have been wondering if there was any better alternative than the standard Sobol (+ Brownian Bridge) quasi random sequence generator for the Monte Carlo simulations of finance derivatives.
Here is what I found:
Scrambled Sobol. The idea is to rerandomize the quasi random numbers slightly. It can provide better uniformity properties and allows for a real estimate of the standard error. There are many ways to do that. The simple Cranley Patterson rotation consisting in adding a pseudo random number modulo 1, Owen scrambling (permutations of the digits) and simplifications of it to achieve a reasonable speed.Time Estimates in Software Development
https://chasethedevil.github.io/post/time-estimates-in-software-development/
Tue, 07 May 2013 21:01:00 +0000https://chasethedevil.github.io/post/time-estimates-in-software-development/Recently, that I completed a project that I had initially estimated to around 2 months, in nearly 4 hours. This morning I fixed the few remaining bugs. I looked at the clock, surprised it was still so early and I still had so many hours left in the day.Now I have more time to polish the details and go beyond the initial goal (I think this scares my manager a bit), but I could (and I believe some people do this often) stop now and all the management would be satisfied.Upper Bounds in American Monte-Carlo
https://chasethedevil.github.io/post/upper-bounds-in-american-monte-carlo/
Tue, 30 Apr 2013 17:05:00 +0000https://chasethedevil.github.io/post/upper-bounds-in-american-monte-carlo/Glasserman and Yu (GY) give a relatively simple algorithm to compute lower and upper bounds of a the price of a Bermudan Option through Monte-Carlo.
I always thought it was very computer intensive to produce an upper bound, and that the standard Longstaff Schwartz algorithm was quite precise already. GY algorithm is not much slower than the Longstaff-Schwartz algorithm, but what's a bit tricky is the choice of basis functions: they have to be Martingales.The Wonderful UN
https://chasethedevil.github.io/post/the-wonderful-un/
Wed, 24 Apr 2013 21:35:00 +0000https://chasethedevil.github.io/post/the-wonderful-un/Already the name United Nations should be suspicious, but now they are shown to have spread Cholera to Haiti, as if the country did not have enough suffering. They have a nice building in New-York, and used to have a popular representative, but unfortunately, for poor countries, they never really achieved much. In Haiti, there were many stories of rapes and corruption by U.N. members more than 10 years ago. The movie The Whistleblower suggests it was the same in the Balkans.Moved From Dropbox to Ubuntu One
https://chasethedevil.github.io/post/moved-from-dropbox-to-ubuntu-one/
Tue, 23 Apr 2013 20:44:00 +0000https://chasethedevil.github.io/post/moved-from-dropbox-to-ubuntu-one/Dropbox worked well, but the company decided to blacklist it. I suppose some people abused it. While looking for an alternative, I found Ubuntu One. It’s funny I never tried it before even though I use Ubuntu. I did not think it was a dropbox replacement, but it is. And you get 5GB instead of Dropbox 2GB limit, which is enough for me (I was a bit above the 2GB limit).Quasi Monte-Carlo & Longstaff-Schwartz American Option price
https://chasethedevil.github.io/post/quasi-monte-carlo--longstaff-schwartz-american-option-price/
Mon, 22 Apr 2013 18:00:00 +0000https://chasethedevil.github.io/post/quasi-monte-carlo--longstaff-schwartz-american-option-price/In the book Monte Carlo Methods in Financial Engineering, Glasserman explains that if one reuses the paths used in the optimization procedure for the parameters of the exercise boundary (in this case the result of the regression in Longstaff-Schwartz method) to compute the Monte-Carlo mean value, we will introduce a bias: the estimate will be biased high because it will include knowledge about future paths.
However Longstaff and Schwartz seem to just reuse the paths in their paper, and Glasserman himself, when presenting Longstaff-Schwartz method later in the book just use the same paths for the regression and to compute the Monte-Carlo mean value.A Fast Exponential Function in Java
https://chasethedevil.github.io/post/a-fast-exponential-function-in-java/
Fri, 19 Apr 2013 16:48:00 +0000https://chasethedevil.github.io/post/a-fast-exponential-function-in-java/In finance, because one often dicretize the log process instead of the direct process for Monte-Carlo simulation, the Math.exp function can be called a lot (millions of times for a simulation) and can be a bottleneck. I have noticed that the simpler Euler discretization was for local volatility Monte-Carlo around 30% faster, because it avoids the use of Math.exp.
Can we improve the speed of exp over the JDK one?Root finding in Lord Kahl Method to Compute Heston Call Price (Part III)
https://chasethedevil.github.io/post/root-finding-in-lord-kahl-method-to-compute-heston-call-price-part-iii/
Fri, 12 Apr 2013 13:41:00 +0000https://chasethedevil.github.io/post/root-finding-in-lord-kahl-method-to-compute-heston-call-price-part-iii/I forgot two important points in my previous post about Lord-Kahl method to compute the Heston call price:
Scaling: scaling the call price appropriately allows to increase the maximum precision significantly, because the Carr-Madan formula operates on log(Forward) and log(Strike) directly, but not the ratio, and alpha is multiplied by the log(Forward). I simply scale by the spot, the call price is (S_0*max(S/S_0-K/S0)). Here are the results for Lord-Kahl, Kahl-Jaeckel (the more usual way limited to machine epsilon accuracy), Forde-Jacquier-Lee ATM implied volatility without scaling for a maturity of 1 day: Strike Lord-Kahl Kahl-Jaeckel Forde-Jacquier-Lee 62.Root finding in Lord Kahl Method to Compute Heston Call Price (Part II)
https://chasethedevil.github.io/post/root-finding-in-lord-kahl-method-to-compute-heston-call-price-part-ii/
Thu, 11 Apr 2013 16:29:00 +0000https://chasethedevil.github.io/post/root-finding-in-lord-kahl-method-to-compute-heston-call-price-part-ii/In my previous post, I explored the Lord-Kahl method to compute the call option prices under the Heston model. One of the advantages of this method is to go beyond machine epsilon accuracy and be able to compute very far out of the money prices or very short maturities. The standard methods to compute the Heston price are based on a sum/difference where both sides are far from 0 and will therefore be limited to less than machine epsilon accuracy even if the integration is very precise.Root finding in Lord Kahl Method to Compute Heston Call Price
https://chasethedevil.github.io/post/root-finding-in-lord-kahl-method-to-compute-heston-call-price/
Tue, 09 Apr 2013 19:49:00 +0000https://chasethedevil.github.io/post/root-finding-in-lord-kahl-method-to-compute-heston-call-price/I just tried to implement Lord Kahl algorithm to compute the Heston call price. The big difficulty of their method is to find the optimal alpha. That’s what make it work or break. The tricky part is that the function of alpha we want to minimize has multiple discontinuities (it’s periodic in some ways). This is why the authors rely on the computation of an alpha_max: bracketing is very important, otherwise your optimizer will jump the discontinuity without even noticing it, while you really want to stay in the region before the first discontinuity.From Double Precision Normal Density to Double Precision Cumulative Normal Distribution
https://chasethedevil.github.io/post/from-double-precision-normal-density-to-double-precision-cumulative-normal-distribution/
Tue, 02 Apr 2013 14:24:00 +0000https://chasethedevil.github.io/post/from-double-precision-normal-density-to-double-precision-cumulative-normal-distribution/Marsaglia in his paper on Normal Distribution made the same mistake I initially did while trying to verify the accuracy of the normal density.In his table of values comparing the true value computed by Maple for some values of x to the values computed by Sun or Ooura erfc, he actually does not really use the same input for the comparison. One example is the last number: 16.6. 16.6 does not have an exact representation in double precision, even though it is displayed as 16.Cracking the Double Precision Gaussian Puzzle
https://chasethedevil.github.io/post/cracking-the-double-precision-gaussian-puzzle/
Fri, 22 Mar 2013 12:20:00 +0000https://chasethedevil.github.io/post/cracking-the-double-precision-gaussian-puzzle/In my previous post, I stated that some library (SPECFUN by W.D. Cody) computes \(e^{-\frac{x^2}{2}}\) the following way: xsq = fint(x * 1.6) / 1.6; del = (x - xsq) * (x + xsq); result = exp(-xsq * xsq * 0.5) * exp(-del *0.5);
where fint(z) computes the floor of z.
Why 1.6? An integer divided by 1.6 will be an exact representation of the corresponding number in double: 1.6 because of 16 (dividing by 1.A Double Precision Puzzle with the Gaussian
https://chasethedevil.github.io/post/a-double-precision-puzzle-with-the-gaussian/
Wed, 20 Mar 2013 17:50:00 +0000https://chasethedevil.github.io/post/a-double-precision-puzzle-with-the-gaussian/Some library computes the Gaussian density function $$e^{-\frac{x^2}{2}}$$ the following way: xsq = fint(x * 1.6) / 1.6; del = (x - xsq) * (x + xsq); result = exp(-xsq * xsq * 0.5) * exp(-del *0.5);
where fint(z) computes the floor of z.
Basically, x*x is rewritten as xsq*xsq+del. I have seen that trick once before, but I just can’t figure out where and why (except that it is probably related to high accuracy issues).A Seasoned Volatility Swap
https://chasethedevil.github.io/post/a-seasoned-volatility-swap/
Thu, 14 Mar 2013 19:55:00 +0000https://chasethedevil.github.io/post/a-seasoned-volatility-swap/This is very much what's in the Carr-Lee paper "Robust Replication of Volatility Derivatives", but it wasn't so easy to obtain in practice:
The formulas as written in the paper are not usable as is: they can be simplified (not too difficult, but intimidating at first)The numerical integration is not trivial: a simple Gauss-Laguerre is not precise enough (maybe if I had an implementation with more points), a Gauss-Kronrod is not either (maybe if we split it in different regions).A Volatility Swap and a Straddle
https://chasethedevil.github.io/post/a-volatility-swap-and-a-straddle/
Tue, 12 Mar 2013 21:36:00 +0000https://chasethedevil.github.io/post/a-volatility-swap-and-a-straddle/A Volatility swap is a forward contract on future realized volatility. The pricing of such a contract used to be particularly challenging, often either using an unprecise popular expansion in the variance, or a model specific way (like Heston or local volatility with Jumps). Carr and Lee have recently proposed a way to price those contracts in a model independent way in their paper “robust replication of volatility derivatives”. Here is the difference between the value of a synthetic volatility swap payoff at maturity (a newly issued one, with no accumulated variance) and a straddle.Parallel Can Be Slower
https://chasethedevil.github.io/post/parallel-can-be-slower/
Wed, 13 Feb 2013 17:05:00 +0000https://chasethedevil.github.io/post/parallel-can-be-slower/I found a nice finite difference scheme, where the solving part can be parallelized on 2 processors at each time-step
I was a bit surprised to notice that the parallelized algorithm ran in some cases twice slower than the same algorithm not parallelized. I tried ForkJoinPool, ThreadPoolExecutor, my one notify/wait based parallelization. All resulted in similar performance compared to just calling thread1.run() and thread2.run() directly.
I am still a bit puzzled by the results.Scala is Mad (part 2)
https://chasethedevil.github.io/post/scala-is-mad-part-2/
Wed, 13 Feb 2013 16:20:00 +0000https://chasethedevil.github.io/post/scala-is-mad-part-2/I still did not abandon Scala despite my previous post, mainly because I have already quite a bit of code, and am too lazy to port it. Furthermore the issues I detailed were not serious enough to motivate a switch. But these days I am more and more fed up with Scala, especially because of the Eclipse plugin. I tried the newer, the beta, and the older, the stable, the conclusion is the same.From OpenSuse to Ubuntu 13.04
https://chasethedevil.github.io/post/from-opensuse-to-ubuntu-13.04/
Fri, 01 Feb 2013 18:22:00 +0000https://chasethedevil.github.io/post/from-opensuse-to-ubuntu-13.04/In my Linux quest, I changed distribution again on my home desktop, from OpenSuse 11.1 with KDE to Ubuntu 13.04 (not yet released - so alpha) with Unity. Why?
KDE was crashing a bit too often for my taste (more than once a week). Although I enjoyed the KDE environment. Not easy to transfer files to my Android 4.2 phone. Ubuntu 13.04 is not fully there yet, but is on its way.Productivity Zero
https://chasethedevil.github.io/post/productivity-zero/
Thu, 24 Jan 2013 22:03:00 +0000https://chasethedevil.github.io/post/productivity-zero/Sometimes it feels like big companies try to enforce the Productivity Zero rule.
Here is a guide:
involve as many team as possible. It will help ensuring endless discussions about who is doing what, and then how do I interface with them. This is most (in)efficient when team managers interact and are not very technically competent. One consequence is that nobody is fully responsible/accountable, which helps reinforce the productivity zero. meetings, meetings and meetings.Better Finite Difference Boundaries with a Tridiagonal Solver
https://chasethedevil.github.io/post/better-finite-difference-boundaries-with-a-tridiagonal-solver/
Thu, 10 Jan 2013 19:19:00 +0000https://chasethedevil.github.io/post/better-finite-difference-boundaries-with-a-tridiagonal-solver/In Pricing Financial Instruments - The Finite Difference Method, Tavella and Randall explain that boundary conditions using a higher order discretization (for example their “BC2” boundary condition) can not be solved in one pass with a simple tridiagonal solver, and suggest the use of SOR or some conjugate gradient based solver.
It is actually very simple to reduce the system to a tridiagonal system. The more advanced boundary conditions only use 3 adjacent values, just 1 value makes it non tridiagonal, the one in bold is the following matrix representationNon Central Chi Squared Distribution in Java or Scala
https://chasethedevil.github.io/post/non-central-chi-squared-distribution-in-java-or-scala/
Thu, 03 Jan 2013 17:21:00 +0000https://chasethedevil.github.io/post/non-central-chi-squared-distribution-in-java-or-scala/I was looking for an implementation of the non central chi squared distribution function in Java, in order to price bond options under the Cox Ingersoll Ross (CIR) model and compare to a finite difference implementation. It turned out it was not so easy to find existing code for that in a library. I would have imagined that Apache common maths would do this but it does not.
OpenGamma has a not too bad implementation.Finite Difference Approximation of Derivatives
https://chasethedevil.github.io/post/finite-difference-approximation-of-derivatives/
Fri, 21 Dec 2012 12:12:00 +0000https://chasethedevil.github.io/post/finite-difference-approximation-of-derivatives/A while ago, someone asked me to reference him in a paper of mine because I used formulas of a finite difference approximation of a derivative on a non uniform grid. I was shocked as those formula are very widespread (in countless papers, courses and books) and not far off elementary mathematics.
There are however some interesting old papers on the technique. Usually people approximate the first derivative by the central approximation of second order:A Discontinuity
https://chasethedevil.github.io/post/a-discontinuity/
Wed, 12 Dec 2012 20:59:00 +0000https://chasethedevil.github.io/post/a-discontinuity/I am comparing various finite difference schemes on simple problems and am currently stumbling upon a strange discontinuity at the boundary for some of the schemes (Crank-Nicolson, Rannacher, and TR-BDF2) when I plot an American Put Option Gamma using a log grid. It actually is more pronounced with some values of the strike, not all. The amplitude oscillates with the strike. And it does not happen on a European Put, so it's not a boundary approximation error in the code.Scala is Mad
https://chasethedevil.github.io/post/scala-is-mad/
Wed, 12 Dec 2012 16:07:00 +0000https://chasethedevil.github.io/post/scala-is-mad/I spent quick a bit of time to figure out why something that is usually simple to do in Java did not work in Scala: Arrays and ArrayLists with generics.
For some technical reason (type erasure at the JVM level), Array sometimes need a parameter with a ClassManifest !?! a generic type like [T :< Point : ClassManifest] need to be declared instead of simply [T :< Point].
And then the quickSort method somehow does not work if invoked on a generic.Local Volatility Delta & Dynamic
https://chasethedevil.github.io/post/local-volatility-delta--dynamic/
Thu, 29 Nov 2012 12:30:00 +0000https://chasethedevil.github.io/post/local-volatility-delta--dynamic/This will be a very technical post, I am not sure that it will be very understandable by people not familiar with the implied volatility surface.
Something one notices when computing an option price under local volatility using a PDE solver, is how different is the Delta from the standard Black-Scholes Delta, even though the price will be very close for a Vanilla option. In deed, the Finite difference grid will have a different local volatility at each point and the Delta will take into account a change in local volatility as well.OpenSuse 12.2
https://chasethedevil.github.io/post/opensuse-12.2/
Wed, 14 Nov 2012 10:12:00 +0000https://chasethedevil.github.io/post/opensuse-12.2/After too many upgrades of Ubuntu, and switching from Gnome to KDE and back, my Ubuntu system became behaving strangely in KDE: authorization issues, frequent crashes, pulseaudio and ardour problems. I decided to give another try to OpenSuse, as Linux makes it easy to switch system without losing too much time reinstalling the useful applications.
It’s been only a few days, but I am pleasantly surprised with OpenSuse. It feels more polished than Kubuntu.GPU computing in Finance
https://chasethedevil.github.io/post/gpu-computing-in-finance/
Mon, 15 Oct 2012 16:14:00 +0000https://chasethedevil.github.io/post/gpu-computing-in-finance/Very interesting presentation from Murex about their GPU computing. Some points were:
GPU demand for mostly exotics pricing and greeks Local vol main model for EQD exotics. Local vol calibrated via PDE approach. Markov functional model becoming main model for IRD. Use of local regression instead of Longstaff Schwartz (or worse CVA like sim of sim). philox RNG from DE Shaw. But the presenter does not seem to know RNGs very well (recommended Brownian Bridge for Mersenne Twister!Pretty Fonts in Chrome with Linux
https://chasethedevil.github.io/post/pretty-fonts-in-chrome-with-linux/
Wed, 12 Sep 2012 18:06:00 +0000https://chasethedevil.github.io/post/pretty-fonts-in-chrome-with-linux/It's a bit incredible, but in 2012, some linux distros (like Fedora, or Kubuntu) still have trouble to have pretty fonts everywhere. I found a nice tip initially for Google Chrome but that seems to improve more than Chrome: create ~/.fonts.conf with the following:
[match target="font"]
[edit name="autohint" mode="assign"]
[bool]true[/bool]
[/edit]
[edit name="hinting" mode="assign"]
[bool]true[/bool]
[/edit]Fedora 17 vs Ubuntu 12.04
https://chasethedevil.github.io/post/fedora-17-vs-ubuntu-12.04/
Wed, 12 Sep 2012 18:03:00 +0000https://chasethedevil.github.io/post/fedora-17-vs-ubuntu-12.04/I had the bad idea to upgrade to the beta Ubuntu 12.10. Something awfully broke in the upgrade. After too much struggling with apt-get & dpkg, I decided to install Fedora 17.
Strangely Fedora feels much faster than Ubuntu 12.04 (the boot time especially). Yum seems also faster than apt-get, especially the update part. Also while the Unity dock is not bad (better than gnome shell dock), the Unity dash thing just makes me crazy, the gnome shell activities, while close, are much easier to use.Binary Voting
https://chasethedevil.github.io/post/binary-voting/
Fri, 07 Sep 2012 17:21:00 +0000https://chasethedevil.github.io/post/binary-voting/How many reports have you had to fill up with a number of stars to choose? How much useless time is spent on figuring the this number just because it is always very ambiguous?
Some blogger wrote an interesting entry on Why I Hate Five Stars Reviews. Basically he advocates binary voting instead via like/dislike. Maybe a ternary system via like/dislike/don't care would be ok too.
One coworker used to advocate the same for a similar reason: people reading those reports only pay attention to the extremes: the 5 stars or the 0 stars.Moving The Needle
https://chasethedevil.github.io/post/moving-the-needle/
Tue, 21 Aug 2012 21:23:00 +0000https://chasethedevil.github.io/post/moving-the-needle/These days the expression “move the needle” is popular where I work. I did not know it was an expression of Steve Jobs.
“The company starts valuing the great salesmen, because they’re the ones who can move the needle on revenues, not the product engineers and designers. So the salespeople end up running the company… Then the product guys don’t matter so much, and a lot of them just turn off.When solar panels don't work
https://chasethedevil.github.io/post/when-solar-panels-dont-work/
Tue, 21 Aug 2012 21:14:00 +0000https://chasethedevil.github.io/post/when-solar-panels-dont-work/I thought I would add another word about keyboard trends. A coworker has bought the Logitech K750, the one with solar panels to recharge the battery. This keyboard has excellent reviews on many websites, or even on Amazon. I somehow always found the idea a bit strange, it looked like the old solar panel calculators that used to be trendy when I was in primary school.Well after maybe 6 months of use, he needs to change the battery!Excel Bulk Entry of Jira using Apache HttpClient & POI
https://chasethedevil.github.io/post/excel-bulk-entry-of-jira-using-apache-httpclient--poi/
Tue, 31 Jul 2012 15:40:00 +0000https://chasethedevil.github.io/post/excel-bulk-entry-of-jira-using-apache-httpclient--poi/Where I work, I have to regularly enter my time in JIRA using their crappy portlet interface. Because of French regulations and bad design, one can enter time for at most 1 day at a time. This is very annoying especially to enter vacation days. I decided to spend some time (took me around 2 hours - I thought it would be much more) to enter the time from a local Excel spreadsheet (via with OpenOffice), and use Java to populate JIRA.Keyboard Porn
https://chasethedevil.github.io/post/keyboard-porn/
Mon, 30 Jul 2012 10:49:00 +0000https://chasethedevil.github.io/post/keyboard-porn/I have been browsing the web, looking for a nice computer keyboard. Programming is a big part of my job, a comfortable keyboard is therefore important to my daily life.
MS Natural keyboard I have some nostalgia for the original Microsoft natural keyboard, the white one with standard home and end keys. When it came out it looked revolutionary. I remember really improving my typing speed on it. The only minor annoyance was the heavy and loud space bar.Adaptive Quadrature for Pricing European Option with Heston
https://chasethedevil.github.io/post/adaptive-quadrature-for-pricing-european-option-with-heston/
Mon, 25 Jun 2012 12:50:00 +0000https://chasethedevil.github.io/post/adaptive-quadrature-for-pricing-european-option-with-heston/The Quantlib code to evaluate the Heston integral for European options is quite nice. It proposes Kahl & Jaeckel method as well as Gatheral method for the complex logarithm. It also contains expansions where it matters so that the resulting code is very robust. One minor issue is that it does not integrate both parts at the same time, and also does not propose Attari method for the Heston integral that is supposed to be more stable.Gnome Shell more stable than Unity on Ubuntu 12.04
https://chasethedevil.github.io/post/gnome-shell-more-stable-than-unity-on-ubuntu-12.04/
Thu, 14 Jun 2012 12:01:00 +0000https://chasethedevil.github.io/post/gnome-shell-more-stable-than-unity-on-ubuntu-12.04/Regularly, the unity dock made some applications inaccessible: clicking on the app icon did not show or start the app anymore, a very annoying bug. This is quite incredible given that this version of Ubuntu is supposed to be long term support. So I decided to give one more chance to Gnome Shell. Installing it on Ubuntu 12.04 is simple with this guide. To my surprise it is very stable so far.John Carmack on Parallelism
https://chasethedevil.github.io/post/john-carmack-on-parallelism/
Fri, 27 Apr 2012 06:40:00 +0000https://chasethedevil.github.io/post/john-carmack-on-parallelism/This is the interesting bit
“Modify some of your utility object code to return new copies instead of self-mutating, and try throwing const in front of practically every non-iterator variable you use”.
http://www.altdevblogaday.com/2012/04/26/functional-programming-in-c/Google Galaxy Nexus Sound Quality Is Great
https://chasethedevil.github.io/post/google-galaxy-nexus-sound-quality-is-great/
Tue, 27 Mar 2012 00:38:00 +0000https://chasethedevil.github.io/post/google-galaxy-nexus-sound-quality-is-great/Many people are not enthusiastic of this phone sound if you read silly forums. They are wrong! the sound coming out of this thin phone is amazing, at least with high quality headphones. I find the akg q601 incredible with it: much much better than with the old ipod nano or the cowon i7.
In general most complaints i have read about the phone were wrong. The battery is ok, the size is great.Why primitive arrays matter in Java
https://chasethedevil.github.io/post/why-primitive-arrays-matter-in-java/
Wed, 29 Feb 2012 10:01:00 +0000https://chasethedevil.github.io/post/why-primitive-arrays-matter-in-java/In the past, I have seen that one could greatly improve performance of some Monte-Carlo simulation by using as much as possible double[][] instead of arrays of objects.
It was interesting to read this blog post explaining why that happens: it is all about memory access.Scala Again
https://chasethedevil.github.io/post/scala-again/
Mon, 06 Feb 2012 17:52:00 +0000https://chasethedevil.github.io/post/scala-again/I am trying Scala again. Last time, several years ago, I played around with it as a web tool, combining it with a Servlet Runner like Tomcat. This time, I play around with it for some quantitative finance experiments.
Why Scala? It still seem the most advanced alternative to Java on the JVM, and the mix of functional programming and OO programming is interesting. Furthermore it goes quite far as it ships with its own library.KDE 4.8 finally has a dock
https://chasethedevil.github.io/post/kde-4.8-finally-has-a-dock/
Fri, 27 Jan 2012 13:38:00 +0000https://chasethedevil.github.io/post/kde-4.8-finally-has-a-dock/KDE 4.8 finally has a dock: you just have to add the plasma icon tasks. Also the flexibility around ALT+TAB is welcome. With Krusader as file manager, Thunderbird and Firefox for email and web, it is becoming a real nice desktop, but it took a while since the very bad KDE 4.0 release.
It is easy to install under ubuntu 11.10 through the backports and seems very stable so far.List of companies where I have been an employee
https://chasethedevil.github.io/post/list-of-companies-where-i-have-been-an-employee/
Wed, 11 Jan 2012 02:14:00 +0000https://chasethedevil.github.io/post/list-of-companies-where-i-have-been-an-employee/Intern:
Siemens (Berlin) IBM (Boeblingen) Osram Sylvania (Beverly, MA) Employee:
Cap Gemini (Paris) working for Alcatel Silicomp (Paris) working for Alcatel Nextenso C2labs / one 0 development (San Francisco, CA) working for Whenmobile, Sony Pictures, GoPix, Technorati. Credit Agricole alternative (Paris) Prima solutions (Paris) Esearchvision (Paris) Ulink (Paris) Edifixio (Paris) Horizon (Paris) Darty (Paris) Calypso (Paris) Generating random numbers following a given discrete probability distribution
https://chasethedevil.github.io/post/generating-random-numbers-following-a-given-discrete-probability-distribution/
Mon, 09 Jan 2012 00:14:00 +0000https://chasethedevil.github.io/post/generating-random-numbers-following-a-given-discrete-probability-distribution/I have never really thought very much about generating random numbers according to a precise discrete distribution, for example to simulate an unfair dice.
In finance, we are generally interested in continuous distributions, where there is typically 2 ways:
the inverse transform (usually computed in a numerical way), and the acceptance-rejection method, typically the ziggurat. The inverse transform is often preferred, because it’s usable method for Quasi Monte-Carlo simulations while the acceptance rejection is not.Quant Interview & Education
https://chasethedevil.github.io/post/quant-interview--education/
Wed, 21 Dec 2011 17:37:00 +0000https://chasethedevil.github.io/post/quant-interview--education/Recently, I interviewed someone for a quant position. I was very surprised to find out that someone who did one of the best master in probabilities and finance in France could not solve a very basic probability problem:
This is accessible to someone with very little knowledge of probabilities When I asked this problem around to co-workers (who have all at least a master in a scientific subject), very few could actually answer it properly.Gnome 3 not so crap after all
https://chasethedevil.github.io/post/gnome-3-not-so-crap-after-all/
Wed, 30 Nov 2011 18:11:00 +0000https://chasethedevil.github.io/post/gnome-3-not-so-crap-after-all/In a previous post, I was complaining how bad Gnome 3 was. Since I have installed a real dock: docky, it is now much more usable. I can easily switch / launch applications without an annoying full screen change.
In addition I found out that it had a good desktop search (tracker). The ALT+F2 also does some sort of completion, too bad it can not use tracker here as well.Good & Popular Algorithms are Simple
https://chasethedevil.github.io/post/good--popular-algorithms-are-simple/
Thu, 17 Nov 2011 12:28:00 +0000https://chasethedevil.github.io/post/good--popular-algorithms-are-simple/I recently tried to minimise a function according to some constraints. One popular method to minimise a function in several dimensions is Nelder-Mead Simplex. It is quite simple, so simple that I programmed it in Java in 1h30, including a small design and a test. It helped that the original paper from Nelder-Mead is very clear:
However the main issue is that it works only for unconstrained problems. Nelder and Mead suggested to add a penalty, but in practice this does not work so well.Gnome 3, Unity, Crap
https://chasethedevil.github.io/post/gnome-3-unity-crap/
Wed, 17 Aug 2011 19:09:00 +0000https://chasethedevil.github.io/post/gnome-3-unity-crap/After the upgrate to Ubuntu 11.04 I was directly on Unity. Having a dock on the left side is nice, but unfortunately, it has various bugs which makes it sometimes annoying. Also the menu on top like Mac Os X is not a bad idea, but it breaks many apps (for example Picasa). Then there is the scrollbar insanity, it’s almost impossible to click on to scroll, and again breaks in some apps (for example Eclipse).Carmack & GPGPU programming
https://chasethedevil.github.io/post/carmack--gpgpu-programming/
Sun, 14 Aug 2011 10:20:00 +0000https://chasethedevil.github.io/post/carmack--gpgpu-programming/Finally someone who shares the same opinion on the current state of GPGPU programming.
John Carmack: On the other hand, we have converted all of our offline processing stuff to ray tracing. For years, the back-end MegaTexture generation for Rage was done with… we had a GPGPU cluster with NVIDIA cards and it was such a huge pain to keep. It was an amazing pain where one system would be having heat problems and would be behaving weird even though we thought they had identical drivers.exp(y*log(x)) Much Faster than Math.pow(x,y)
https://chasethedevil.github.io/post/expylogx-much-faster-than-math.powxy/
Fri, 08 Apr 2011 23:03:00 +0000https://chasethedevil.github.io/post/expylogx-much-faster-than-math.powxy/Today I found out that replacing Math.pow(x,y) by Math.exp(yMath.log(x))* made me gain 50% performance in my program. Of course, both x and y are double in my case. I find this quite surprising, I expected better from Math.pow.Best Headphones Ever?
https://chasethedevil.github.io/post/best-headphones-ever/
Wed, 06 Apr 2011 13:08:00 +0000https://chasethedevil.github.io/post/best-headphones-ever/I just miraculously received some AKG Q701 headphones. I never tried really high end headphones before those. I was used to my Sennheiser HD555, which I thought were quite good already.
I always thought there was not much difference between let’s say a $100 headphone and a $500 one, and that only real audiophiles would be able notice the difference: people like Jake who can distinguish artefacts in 320kbps mp3, but not people like me.SIMD and Mersenne-Twister
https://chasethedevil.github.io/post/simd-and-mersenne-twister/
Sat, 05 Feb 2011 13:18:00 +0000https://chasethedevil.github.io/post/simd-and-mersenne-twister/Since 2007, there is a new kind of Mersenne-Twister (MT) that exploits SIMD architecture, the SFMT. The Mersenne-Twister has set quite a standard in random number generation for Monte-Carlo simulations, even though it has flaws.
I was wondering if SFMT improved the performance over MT for a Java implementation. There is actually on the same page a decent Java port of the original algorithm. When I ran it, it ended up slower by more than 20% than the classical Mersenne-Twister (32-bit) on a 64-bit JDK 1.XORWOW L'ecuyer TestU01 Results
https://chasethedevil.github.io/post/xorwow-lecuyer-testu01-results/
Wed, 12 Jan 2011 20:26:00 +0000https://chasethedevil.github.io/post/xorwow-lecuyer-testu01-results/Nvidia uses XorWow random number generator in its CURAND library. It is a simple and fast random number generator with a reasonably long period. It can also be parallelized relatively easily. Nvidia suggests it passes L'Ecuyer TestU01, but is not very explicit about it. So I've decided to see how it performed on TestU01.
I found very simple to test a new random number generator on TestU01, the documentation is great and the examples helpful.The CUDA Performance Myth
https://chasethedevil.github.io/post/the-cuda-performance-myth/
Mon, 03 Jan 2011 16:07:00 +0000https://chasethedevil.github.io/post/the-cuda-performance-myth/There is an interesting article on how to generate efficiently the inverse of the normal cumulative distribution on the GPU. This is useful for Monte-Carlo simulations based on normally distributed variables.
Another result of the paper is a method (breakless algorithm) to compute it apparently faster than the very good Wichura’s AS241 algorithm on the CPU as well keeping a similar precision. The key is to avoid branches (if-then) at the cost of not avoiding log() calls.Firefox 4 Is Great
https://chasethedevil.github.io/post/firefox-4-is-great/
Wed, 22 Dec 2010 16:03:00 +0000https://chasethedevil.github.io/post/firefox-4-is-great/I temporarily abandonned Firefox for Chrome/Chromium. I am now back at using Firefox as Firefox 4 is as fast or faster than Chrome and seems more stable, especially under linux. Also it does not send anything to Google and there is bookmark sync independently of Google.
I am impressed that Mozilla managed to improve Firefox that much.Another Look at Java Matrix Libraries
https://chasethedevil.github.io/post/another-look-at-java-matrix-libraries/
Mon, 29 Nov 2010 12:45:00 +0000https://chasethedevil.github.io/post/another-look-at-java-matrix-libraries/A while ago, I was already looking for a good Java Matrix library, complaining that there does not seem any real good one where development is still active: the 2 best ones are in my opinion Jama and Colt.
Recently I tried to price options via RBF (radial basis functions) based on TR-BDF2 time stepping. This is a problem where one needs to do a few matrix multiplications and inverses (or better, LU solve) in a loop.Java enum Is Evil
https://chasethedevil.github.io/post/java-enum-is-evil/
Thu, 12 Aug 2010 17:32:00 +0000https://chasethedevil.github.io/post/java-enum-is-evil/Before Java 1.5, I never really complained about the lack of enum keyword. Sure the old enum via class pattern was a bit verbose at first (N.B.: Java 1.5 enums can also be verbose once you start adding methods to them). But more importantly, you would often use the table lookup pattern in combination.
The problem with Java 1.5 enum is that it is not Object-Oriented. You can't extend an enum, you can't add an element in an existing enum.A Very Interesting Feature of Scala
https://chasethedevil.github.io/post/a-very-interesting-feature-of-scala/
Sat, 07 Aug 2010 12:35:00 +0000https://chasethedevil.github.io/post/a-very-interesting-feature-of-scala/I tried Scala a few years ago. There are several good ideas in it, but I found the language to be a bit too complicated to master. But I recently stubbled upon a paper on Scala generics that might change my mind about using Scala.
Scala Generics used to work in a similar way as Java Generics: via type erasure. One main reason is compatibility with Java, another is that C++ like templates make the code base blow up.Street Fighting Mathematics Book
https://chasethedevil.github.io/post/street-fighting-mathematics-book/
Wed, 28 Jul 2010 14:25:00 +0000https://chasethedevil.github.io/post/street-fighting-mathematics-book/The MIT has a downloadable book on basic mathematics: Street Fighting Mathematics. I liked the part focused on the geometrical approach. It reminded me of the early greek mathematics.
Overall it does look like a very American approach to Maths: answering a multiple choices questions test by elimination. But it is still an interesting book.Bye Bye Firefox
https://chasethedevil.github.io/post/bye-bye-firefox/
Wed, 21 Jul 2010 15:30:00 +0000https://chasethedevil.github.io/post/bye-bye-firefox/I have been a long user of Firefox, mostly thanks to the adblock extension. But recently, Firefox decided to change the way arrows work on the web pages, they don’t make the page scroll anymore. Meanwhile Chrome has now a good adblock plugin (that filters ads on load, not after load like it use to be) and is really much much faster than Firefox. So there is no more reason not to use it.Diffusion Limited Aggregation Applet
https://chasethedevil.github.io/post/diffusion-limited-aggregation-applet/
Wed, 09 Jun 2010 14:05:00 +0000https://chasethedevil.github.io/post/diffusion-limited-aggregation-applet/Yes, I wrote an applet. I know it is very 1990s but, amazingly, it still does the job quite well. Ok, next time I should really use Flash to do this.
The Applet simulates Diffusion Limited Aggregation as described in Chaos And Fractals from Peitgen, Juergens, and Saupe. It represents ions randomly wandering around (in a Brownian motion) until they are caught by an attractive force in electrochemical deposition experiment.Java & 3D Surface
https://chasethedevil.github.io/post/java--3d-surface/
Fri, 18 Dec 2009 16:07:00 +0000https://chasethedevil.github.io/post/java--3d-surface/I have been looking all around the web for a Java library that can draw a simple 3D surface. And I did not find any. Most charting library, including the well known JFreeChart, can only draw 2D charts.
I am quite shocked that something that has been in Excel for 15 years is still not available in Java. And it’s not easy to make your own.double[][] Is Fine
https://chasethedevil.github.io/post/double-is-fine/
Thu, 26 Nov 2009 14:51:00 +0000https://chasethedevil.github.io/post/double-is-fine/In my previous post, I suggest that keeping a double[] performs better than keeping a double[][] if you do matrix multiplications and other operations.
This is actually not true. I benchmarked 3 libraries, Colt (uses double[]), Apache Commons Math (uses double[][]) and Jama (uses double[][] cleverly). At first it looks like Jama has a similar performance as Colt (they avoid [][] slow access by a clever algorithm). But once hotspot hits, the difference is crazy and Jama becomes the fastest (Far ahead).The Pain of Java Matrix Libraries
https://chasethedevil.github.io/post/the-pain-of-java-matrix-libraries/
Thu, 26 Nov 2009 09:17:00 +0000https://chasethedevil.github.io/post/the-pain-of-java-matrix-libraries/Looking for a good Java Matrix (and actually also math) library, I was a bit surprised to find out there does not seem to be any really serious one still maintained.
Sure, there is Apache Commons Math, but it is still changing a lot, and it is not very performance optimized yet, while it has been active for several years already. There is also Java3D, it does Matrix through GMatrix, but not much linear algebra and if you look at their implementation, it is very basic, not performance oriented.Java Calendar Is Broken On JVM Upgrade
https://chasethedevil.github.io/post/java-calendar-is-broken-on-jvm-upgrade/
Wed, 19 Aug 2009 13:47:00 +0000https://chasethedevil.github.io/post/java-calendar-is-broken-on-jvm-upgrade/We ran into an interesting issue with TimeZone and Dates. If you print the same date on different JVMs, it might show a different printed date.
The reason behind this is the daylight saving time conventions. An old JVM won't necessarily have the same daylight saving time for a given TimeZone than a latest JVM, and therefore will interpret the date differently.
Here is the output of a very simple program on 2 different JVMs.Implicit Finite Differences Method For Pricing Barrier Option
https://chasethedevil.github.io/post/implicit-finite-differences-method-for-pricing-barrier-option/
Mon, 17 Aug 2009 12:04:00 +0000https://chasethedevil.github.io/post/implicit-finite-differences-method-for-pricing-barrier-option/While trying to price a simple knock down and out barrier option, I encountered several difficulties I did not expect with the implicit finite differences method. The explicit method has less issues with barrier options pricing. I will show here what the tricky parts are and why explicit seems simpler in this case.
The full article is here (pdf) or here (html) (the later is not very well formatted).Pulseaudio Nightmares - Pure ALSA to the Rescue
https://chasethedevil.github.io/post/pulseaudio-nightmares---pure-alsa-to-the-rescue/
Sat, 27 Jun 2009 18:19:00 +0000https://chasethedevil.github.io/post/pulseaudio-nightmares---pure-alsa-to-the-rescue/In the latest stable Ubuntu (9.04), pulseaudio still does not work reliably on my hardware (intel HDA with digital SPDIF out). I upgraded to 9.10 and had even more problems. Sound always worked on boot, but often broke down after a while. And I could not find easy ways to make it work other than rebooting... Killing/restarting pulseaudio, looking at the processes using snd did not work.
One thing works wonderfully, pure ALSA.Java int Overflow Behavior
https://chasethedevil.github.io/post/java-int-overflow-behavior/
Mon, 15 Jun 2009 16:15:00 +0000https://chasethedevil.github.io/post/java-int-overflow-behavior/A coworker recently asked me if there was a guaranteed behavior in the case of int overflow. He gave the specific example on:
can we rely that int x = Integer.MAX_VALUE + 1 is the same for every JVM on any platform?
I thought the answer would be easy to find in the Java specifications document. But I was wrong. It is not clearly defined.
I found a trick that suggests this behavior is indeed standard and will stay the same, it is related to type casting.Static Fields and Inheritance
https://chasethedevil.github.io/post/static-fields-and-inheritance/
Mon, 15 Jun 2009 16:02:00 +0000https://chasethedevil.github.io/post/static-fields-and-inheritance/Someone asked me recently to find out the real reason why the code from this thread fails. This is a fairly bad code, and not even a very good way to point out the problem. But the question is nonetheless interesting.
class Toto extends TotoParent{
final static Toto a = new Toto ("a");
public Toto(String a){
super(a);
}
}
import java.util.ArrayList;
import java.util.List;
public abstract class TotoParent {
static List list = new ArrayList();Benchmarking Languages Is Difficult
https://chasethedevil.github.io/post/benchmarking-languages-is-difficult/
Wed, 03 Jun 2009 16:53:00 +0000https://chasethedevil.github.io/post/benchmarking-languages-is-difficult/I often looked at the famous computer languages shootout for fun. Recently I noticed they had the infamous thread ring test. I posted not very long ago several blog entries about it showing how silly this test was.
Looking at the existing Java implementation for the test I decided to try to submit the tricky one using a pool of thread, and pooling message processing rather creating 1 thread per node.Cholesky & Jakarta Commons Math
https://chasethedevil.github.io/post/cholesky--jakarta-commons-math/
Fri, 15 May 2009 19:01:00 +0000https://chasethedevil.github.io/post/cholesky--jakarta-commons-math/In Finance, Cholesky is a useful way to decompose Matrix. It is not so simple to find a BSD licensed code using cholesky (most of them are GPL like this one). There is one in Apache Commons Maths library, which is a very interesting library. However for performance, it is still not very practical for some things like Cholesky.
Looking at the source one can easily understand why. I did a small (many people will say not representative 1 million loop test) and finds out:Hull American Option Price Fallacies
https://chasethedevil.github.io/post/hull-american-option-price-fallacies/
Fri, 15 May 2009 16:01:00 +0000https://chasethedevil.github.io/post/hull-american-option-price-fallacies/Hull says American put is best exercised immediately and american call is optimal at expiry like a european. Is this really true?
At first it seems really clever and model show clearly this. But if we change the market assumptions only a tiny bit, everything falls down.
I could not detail everything in a blog post so I created a static web page about it. Everything was produced in Java using algorithm found in popular books and graphs through JFreeChart.On Quasi Random Numbers - MersenneTwister vs Sobol precision in Asian Option Pricing
https://chasethedevil.github.io/post/on-quasi-random-numbers---mersennetwister-vs-sobol-precision-in-asian-option-pricing/
Tue, 05 May 2009 15:02:00 +0000https://chasethedevil.github.io/post/on-quasi-random-numbers---mersennetwister-vs-sobol-precision-in-asian-option-pricing/While starting a side project that does Monte Carlo pricing in Java (http://code.google.com/p/javamc/ - nothing yet there I am waiting for Mercurial repository support), I wondered what was the importance of quasi random numbers versus more regular pseudo random numbers in Monte Carlo simulations.
This brought me to read more carefully several books about Monte Carlo and Finance (Haug Option Pricing, Sobol Primer on Monte Carlo, and Glasserman Monte Carlo Methods in Finance Engineering).Java Logging Still Crap in 2009
https://chasethedevil.github.io/post/java-logging-still-crap-in-2009/
Fri, 24 Apr 2009 15:01:00 +0000https://chasethedevil.github.io/post/java-logging-still-crap-in-2009/When java logging API was first introduced in JDK 1.4 in 2002, it caused quite a lot a fuss around, with everybody asking “Why did not they just include Log4j instead of creating their own bastard child?”.
I remember having looked at it very shortly before continuing using Log4j on all projects I have been involved with.
Today, while doing a very small project, I tried once more to use java logging.Bachelier vs. Black
https://chasethedevil.github.io/post/bachelier-vs.-black/
Mon, 23 Mar 2009 17:58:00 +0000https://chasethedevil.github.io/post/bachelier-vs.-black/Black and Scholes gives a strange result for the price of a binary option under high volatility. You will learn here how to simulate a stock price evolution using Java, and how to show it using JFreeChart library. It starts with more complex concepts (don't be afraid) and goes done towards simpler things.
I could not write all that in a blog format, so I created a old HTML page about it here and a PDF version.Linux Audio State = Miserable
https://chasethedevil.github.io/post/linux-audio-state--miserable/
Thu, 19 Mar 2009 12:39:00 +0000https://chasethedevil.github.io/post/linux-audio-state--miserable/There are lots of programs for playing MP3 under linux, a few dealing decently with big libraries. But when you start looking for a program that does crossfade well and manage big libraries easily - there is nothing.
Rhythmbox does some crossfade, but crashes when you move manually in the song. Audacious does some crossfade but regularly crashes with crossfade plugin.
The real alternative are AIMP2 or Foobar2000 in Wine. It is quite incredible that you can have good solid crossfade in wine and not natively in Linux.Senior Developers Team Productivity X4 (from MS Research Paper)
https://chasethedevil.github.io/post/senior-developers-team-productivity-x4-from-ms-research-paper/
Tue, 10 Feb 2009 10:44:00 +0000https://chasethedevil.github.io/post/senior-developers-team-productivity-x4-from-ms-research-paper/There is a very interesting MS Research paper about test driven development (TDD). It is one of the only real study about it that I know of. The paper conclusions from experiments over 4 TDD teams vs 4 traditional teams is:
"TDD seems to be applicable in various domains and can significantly reduce the defect density of developed software without significant productivity reduction of the development team"Their data gives also other interesting results:The End Of Rings Around Plain Java - A Better Concurrency Test
https://chasethedevil.github.io/post/the-end-of-rings-around-plain-java---a-better-concurrency-test/
Thu, 15 Jan 2009 15:54:00 +0000https://chasethedevil.github.io/post/the-end-of-rings-around-plain-java---a-better-concurrency-test/In my previous post, I was wondering why single thread was faster. D Andreou gave the correct explanation: as we send only 1 start message and as each node only send 1 message to the next one, there is always only 1 message being processed. So the test is optimum on 1 thread. It does not make much sense to make a multithreading benchmark on a problem that is fundamentally single threaded.Object Oriented Analysis And Design with Applications Book Review
https://chasethedevil.github.io/post/object-oriented-analysis-and-design-with-applications-book-review/
Thu, 08 Jan 2009 17:24:00 +0000https://chasethedevil.github.io/post/object-oriented-analysis-and-design-with-applications-book-review/A while ago, I had a comment from someone implying I knew nothing about OO programming because I had not mentioned (and therefore read) Object Oriented Analysis And Design with Applications from G. Booch. I was intrigued by such a silly comment and decided to look at this book that was considered as the bible of OOP.
Well, I don’t find it that good! But I don’t find the bible particularly good either.Running Rings Around Plain Java - The Killer Code
https://chasethedevil.github.io/post/running-rings-around-plain-java---the-killer-code/
Thu, 08 Jan 2009 13:21:00 +0000https://chasethedevil.github.io/post/running-rings-around-plain-java---the-killer-code/I wrote my previous post too fast. I found a very simple change that increases the speed x6!
The idea is too process messages in a ThreadPoolExecutor. As my Nodes are Runnable, I just needed to initialize a common ThreadPoolExecutor, and in a sendMessage, execute the runnable each time.
Here is the full code: public class OptimizedRing {
private ExecutorService executor;
public static void main(String[] args) throws Exception {
OptimizedRing ring = new OptimizedRing();
RingNode node = ring.startRing(Integer.parseInt(args[0]));
node.sendMessage(new StartMessage());
}Running rings around plain Java
https://chasethedevil.github.io/post/running-rings-around-plain-java/
Thu, 08 Jan 2009 12:26:00 +0000https://chasethedevil.github.io/post/running-rings-around-plain-java/Alex Miller has a very interesting test of Actors. He finds out Scala performance is relatively low compared to Erlang, and Kilim is very near Erlang. But Kilim code is the most difficult to read in the lot.
I thought it would be simple to just do the same test in plain Java. I wrote the code for it duplicating the scala logic using Threads instead of Actors.
public class SimpleRing { public static void main(String[] args) throws Exception { SimpleRing ring = new SimpleRing(); RingNode node = ring.More Double Troubles
https://chasethedevil.github.io/post/more-double-troubles/
Tue, 06 Jan 2009 12:12:00 +0000https://chasethedevil.github.io/post/more-double-troubles/We saw in a previous entry how one has to be careful with Double.NaN. Today we will see how regular double can cause problems. By the way the NaN issue was not Java specific and this issue is also general in different programming languages.
A coworker was shocked that in Java (I was a bit surprised he saw that only today, but it is true it can be surprising that such a simple thing does not work as expected):Java Programmers Are Idiots?
https://chasethedevil.github.io/post/java-programmers-are-idiots/
Wed, 17 Dec 2008 20:16:00 +0000https://chasethedevil.github.io/post/java-programmers-are-idiots/My brother just sent me a funny quote. I don’t know if it is true or not:
entwickeln Sie lieber überzeugende Lösungen anstatt viele Stunden mit Coding zu verbringen? Ist Ihnen die Produktivität Ihres Teams wichtig?
Mark Driver, VP Research von Gartner, kommentierte kürzlich
“Here’s a simple equation. In terms of mental fortitude… 1 Smalltalk developer = 2.5 C++ developers 1 C++ developer = 1.5 Java developers”.
You don’t need german to understand.Double.NaN Is Evil
https://chasethedevil.github.io/post/double.nan-is-evil/
Tue, 09 Dec 2008 16:23:00 +0000https://chasethedevil.github.io/post/double.nan-is-evil/ I don't know what Sun had in mind when creating Double.NaN number. It is very inintuitive to use. I am sure every single developer out there fell in the trap of trying to find out if a double was NaN or not using:
Double.NaN == myDouble
This does not work (I don't know the real reason why), one has to use:
Double.isNaN(myDouble)
Not intuitive! Grails Spring Union Not Surprising
https://chasethedevil.github.io/post/grails-spring-union-not-surprising/
Thu, 27 Nov 2008 17:18:00 +0000https://chasethedevil.github.io/post/grails-spring-union-not-surprising/Looking out at some old post. I found out I was not far from the truth in January 2008 when I stated:“In 2008 the Ruby On Rails mentality will continue to prevail. In the Java world, Grails is the most likely to benefit from it. (…) It could also be something based around Spring as their current MVC solution is not very good and very old fashioned."I don’t think I will be right with the provocative Java is dead.Java Is Dead
https://chasethedevil.github.io/post/java-is-dead/
Fri, 21 Nov 2008 20:24:00 +0000https://chasethedevil.github.io/post/java-is-dead/These days, I have the feeling that Java is dead. Even if, or maybe because I have used Java so much in the past 10 years, I have this feeling.
In 1998 Java was revolutionary. It was a very simple to learn object oriented language with modern concepts and familiar syntax. Furthermore the standard library had neat features like internet networking and it could be integrated in the browser. All this at a time when the internet just started to be popular.Why ArchLinux Is Better Than Ubuntu
https://chasethedevil.github.io/post/why-archlinux-is-better-than-ubuntu/
Fri, 14 Nov 2008 10:41:00 +0000https://chasethedevil.github.io/post/why-archlinux-is-better-than-ubuntu/It has been now a week since I have installed ArchLinux on my home computer. I daily use Ubuntu 8.10 at work.
Since the Ubuntu upgrade from 8.04 to 8.10 I have had problems with my Xorg settings. I just found out the nvidia-settings utility does not manage to save the configuration anymore. So I have to lookup on google and try to fix it. And that annoys me. That annoys me because the promess of Ubuntu is that everything works out of the box.KDE 4.1.3 (again) on ArchLinux
https://chasethedevil.github.io/post/kde-4.1.3-again-on-archlinux/
Sat, 08 Nov 2008 15:54:00 +0000https://chasethedevil.github.io/post/kde-4.1.3-again-on-archlinux/I tried another silly thing with Linux, ArchLinux. The setup is quite rough as you have to edit many config files manually. But if you know a bit your way around it takes only a few hours to have everything running well. The installation manual on the wiki is detailed enough to correct all eventual mistakes humans do.
I decided to try once more KDE 4 on it, as at first it was just a silly experiment: I was really not sure ArchLinux would be workable.Stupid Programmer Interviews
https://chasethedevil.github.io/post/stupid-programmer-interviews/
Wed, 17 Sep 2008 10:56:00 +0000https://chasethedevil.github.io/post/stupid-programmer-interviews/I have read a blog post a few days ago about someone thinking a good programmer interview question was:
How does a hash table work?
While it is a very interesting question, I doubt many programmers (even relatively good ones) can answer that question. If I look back and think of all the employees in all the companies I have known, I can count on one hand people that can answer that question.The Art of Multiprocessor Programming Book Review
https://chasethedevil.github.io/post/the-art-of-multiprocessor-programming-book-review/
Thu, 11 Sep 2008 19:32:00 +0000https://chasethedevil.github.io/post/the-art-of-multiprocessor-programming-book-review/I don’t remember why I started to subscribe to the Java concurrency-interest list. I find that overall, it is an excellent mailing list.
There was a post at one point about the Dante Inferno’s problem. It triggered my attention, so I decided to buy the book the post was referring to, The Art of Multiprocessor Programming by M Herlihy and N. Shavit.
The books starts with the basics, and is very didactic in its approach.OO Desillusion
https://chasethedevil.github.io/post/oo-desillusion/
Thu, 28 Aug 2008 17:00:00 +0000https://chasethedevil.github.io/post/oo-desillusion/I have read many inspiring books about object oriented programming. I find B. Meyer Object Oriented Software Construction one of the best in the lot. B. Meyer tries to explain in a progressive way why OO is better, by introducing it bit by bit. I have read different related design patterns book, the GoF one, Martin Fowler ones. I have been programming Java for about 10 years now. And yet, today, I feel unconvinced.Linus vs OpenBSD
https://chasethedevil.github.io/post/linus-vs-openbsd/
Thu, 17 Jul 2008 11:38:00 +0000https://chasethedevil.github.io/post/linus-vs-openbsd/Today’s popular story is Linus Torvalds message to OpenBSD where he writes:
I think the OpenBSD crowd is a bunch of masturbating monkeys
Beside that provoking sentence he has a valid point. Security bugs should not be more important than other bugs. Too often, management and psychology encourage making security bugs a very important issue and security people VIPs. I have seen this over and over.Suse 11 with KDE4
https://chasethedevil.github.io/post/suse-11-with-kde4/
Thu, 17 Jul 2008 11:38:00 +0000https://chasethedevil.github.io/post/suse-11-with-kde4/I was very disappointed by KDE 4.0 when I first tried it on an ubuntu machine. It was just unusable. I would not have even considered it as a beta.
I changed the system on my home laptop because Ubuntu with KDE 4 was there. I decided to go for something more roots. I had good memories of Gentoo when I tried it some years ago. Maybe I just became too old to appreciate it anymore.Java Compilation Performance / Processor Speed
https://chasethedevil.github.io/post/java-compilation-performance--processor-speed/
Tue, 01 Jul 2008 19:50:00 +0000https://chasethedevil.github.io/post/java-compilation-performance--processor-speed/I just found out my laptop was faster in default settings than my home desktop to compile a resonably sized project (5 min vs 6 min). I was surprised as I thought the disk in the desktop would make a big difference. The processor in my desktop is not that great (simple pentium e2180). My laptop has a 2ghz core2duo processor. In Ghz processor are of the same speed.
I tried to overclock my home pc to see what difference it could make, I made it run at 2.Firefox 3
https://chasethedevil.github.io/post/firefox-3/
Wed, 18 Jun 2008 11:26:00 +0000https://chasethedevil.github.io/post/firefox-3/I tried Firefox 3 twice before, while it was in alpha and beta. I was not impressed at all, it seemed buggy (normal for alpha) and I found the new location bar behavior unintuitive. It did not seem that much faster either. So I always quickly went back to Firefox 2.
I tried again recently, funnily, because of a bad Kernel update. One day, after a kernel update, my laptop started to run only at a max of 800Mhz, I did not notice it immediately.Trying Google AppEngine
https://chasethedevil.github.io/post/trying-google-appengine/
Tue, 17 Jun 2008 19:26:00 +0000https://chasethedevil.github.io/post/trying-google-appengine/I finally took some time to try Google AppEngine. It used to be easy to find free PHP hosting around 2000. It became a rarity. So writing small experiments for free on the web was difficult. Experiments are back thanks to Google with their AppEngine. Many aspects of it are quite interesting and show where they focus.
First it is all Python. It makes sense as I believe Guido v Rossum, Python creator, works for Google.Option, Futures and Other Derivatives Book Review
https://chasethedevil.github.io/post/option-futures-and-other-derivatives-book-review/
Mon, 16 Jun 2008 17:06:00 +0000https://chasethedevil.github.io/post/option-futures-and-other-derivatives-book-review/Option, Futures and Other Derivatives is by far the most popular book in finance. You will find it in every finance company, on many desks.
It is a very good introduction for people not familiar with standard financial products. This kind of book is unavoidable to understand the basis. It goes also beyond with the chapters on pricing and hedging. These 2 chapters make one understand many other book. If one understands the Black and Scholze formula, one can easily approach many other pricing formula, as in a way, there are all similar in their approach.Structured Equity Derivatives Book Review
https://chasethedevil.github.io/post/structured-equity-derivatives-book-review/
Mon, 16 Jun 2008 16:55:00 +0000https://chasethedevil.github.io/post/structured-equity-derivatives-book-review/If one has to learn about equity derivatives, beside the classic Option, Futures and Other Derivatives from Hull, Structured Equity Derivatives by Harry M Kat is a must read.
His ideas are presented in a software developer friendly way, as his goal is to show how different equity derivatives products are behind the scenes, very similar.
I enjoyed the variety of exotic products presented and the very detailed way in which they are explainedFedora Linux & Apple Bluetooth Keyboard
https://chasethedevil.github.io/post/fedora-linux--apple-bluetooth-keyboard/
Thu, 05 Jun 2008 20:05:00 +0000https://chasethedevil.github.io/post/fedora-linux--apple-bluetooth-keyboard/It took me a long time to have the Apple Bluetooth Keyboard (slim aluminium model) working well with Fedora 9. Thanks to the Ubuntu documentation, it is quite easy to establish a connection manually through hidd commands. It was unfortunately much more difficult to have it automatically recognized and not disconnected after a few minutes without use.
The following configuration should work with any other distro and probably other bluetooth keyboards as well.DecimalFormat Is Broken
https://chasethedevil.github.io/post/decimalformat-is-broken/
Wed, 14 May 2008 18:19:00 +0000https://chasethedevil.github.io/post/decimalformat-is-broken/A friend of mine recently noticed that the good old DecimalFormat class is "broken". If you try to parse a string that is not a number but is starting with a number, the DecimalFormat.parse will return what it managed to parse.
The correct behavior should be to throw a parse exception IMHO. Judging from an old post in the Sun bug tracker, The folks at Sun don't think it really is, they call the default mode of parsing the "Using MiG Layout For Better Swing Development
https://chasethedevil.github.io/post/using-mig-layout-for-better-swing-development/
Tue, 29 Apr 2008 18:27:00 +0000https://chasethedevil.github.io/post/using-mig-layout-for-better-swing-development/I have forgotten a few libraries in my Better Swing Development article, and notably MiGLayout.
GridBagLayout is too verbose, and still feels too clumsy. This is why a while back I wrote a small tool to help visualize various GridBagLayouts for people who are not used to it. But it would have been much simpler to use a better layout instead.
MiGLayout is good, I managed to have good results without almost any practices on not so simple layouts._the_ Google 1998 paper
https://chasethedevil.github.io/post/_the_-google-1998-paper/
Fri, 25 Apr 2008 14:22:00 +0000https://chasethedevil.github.io/post/_the_-google-1998-paper/I have just read the anatomy of a search engine from S. Brin and L. Page. For those who don’t know, it is the Google paper. I have read other google labs papers in the past. What I like in this one is that you can follow how they came into having the Google ideas, how they assembled their ideas.
I should have read that a long time ago.Fedora 9 Already Stable
https://chasethedevil.github.io/post/fedora-9-already-stable/
Fri, 25 Apr 2008 11:33:00 +0000https://chasethedevil.github.io/post/fedora-9-already-stable/Fedora 9 I “upgraded” my home computer to Fedora 9. “upgraded” because I reinstalled the OS instead of using the upgrade procedure. I have had so many issues with “partial” upgrades in the past (with any distro).
Although it is the preview/RC1 version, Fedora 9 is already as stable as a release IMHO. No issues so far, it feels more polished than Fedora 8. OpenJDK 1.6 is there. Firefox 3 is there.SwiXml Review
https://chasethedevil.github.io/post/swixml-review/
Thu, 24 Apr 2008 12:19:00 +0000https://chasethedevil.github.io/post/swixml-review/Externalizing the screen layout is a natural step for many applications. It can be because a customer might want a slightly different presentation, or just for the sake of clearly separating layout code, or for using a kind of screen generator. Back in 2003, I wrote a small utility to help with GridBagLayout, nothing fantastic, but there was the feature of saving a generated layout in XML (or Beanshell) and using it in an application.Better Java Swing Development
https://chasethedevil.github.io/post/better-java-swing-development/
Thu, 17 Apr 2008 20:55:00 +0000https://chasethedevil.github.io/post/better-java-swing-development/It has been a while since I have looked at the different options for building GUIs in Java. I like the approach taken by Eclipse, they provide not only GUI components, but a complete GUI application framework. Several years ago, I have stolen ideas from it (how they manage plugins) and applied it for Swing applications. This worked out quite well. The Netbeans platform now offers a more interesting alternative if you have to do Swing.Fedora 8 vs. Ubuntu 8
https://chasethedevil.github.io/post/fedora-8-vs.-ubuntu-8/
Thu, 28 Feb 2008 14:23:00 +0000https://chasethedevil.github.io/post/fedora-8-vs.-ubuntu-8/I had the bad idea of trying (K)ubuntu 8.04 on my home computer. It worked for a few days, but as Ubuntu 8 is still in alpha, changes tend to break everything easily. At one point Wine stopped working, then the DVD, then the sound. I had crashes with USB plug/unplug. It was time to go back to a stable distro. I went back to Fedora 8.
I found out that I had missed some positive sides of Fedora 8 before.Windows Vista Is Crap!
https://chasethedevil.github.io/post/windows-vista-is-crap/
Fri, 08 Feb 2008 17:59:00 +0000https://chasethedevil.github.io/post/windows-vista-is-crap/It has been already 1 year since Windows Vista is out. In my new company, I had a new computer with Vista on it. I quickly installed Ubuntu in dual boot. I was happy with Ubuntu for my work, until I received many Excel files OpenOffice was not able to read properly. I decided to give a try to Vista. My first impression of it when I had the computer was quite negative.The 2008 Java Web Framework
https://chasethedevil.github.io/post/the-2008-java-web-framework/
Tue, 22 Jan 2008 11:50:00 +0000https://chasethedevil.github.io/post/the-2008-java-web-framework/One of my first web framework was a custom one, based on the book Web Development with Java Server Pages. That was in 1999, when Struts was not yet known. But it was web-MVC, very near from what Struts gave later, without the custom tag stuff (custom tags were not yet part of JSP specifications).
Until 2007, Struts was IMHO the most used web framework and the default choice, even though many contenders appeared, with more features, better code.KDE4 Still Not Ready
https://chasethedevil.github.io/post/kde4-still-not-ready/
Fri, 18 Jan 2008 19:08:00 +0000https://chasethedevil.github.io/post/kde4-still-not-ready/I tried KDE4.0 last week, when it was everywhere in the news. I was very disappointed.
I have a long experience of trying beta software, not well known software. I have used Linux since 1998 (partly). I have even used windows beta at one point. And I have seen nothing as crappy as KDE4.0 release.
It is not usable at all.
Now I can understand what are KDE motivations to do such a bad release.Fedora 8 - The Comeback
https://chasethedevil.github.io/post/fedora-8---the-comeback/
Sun, 23 Dec 2007 02:28:00 +0000https://chasethedevil.github.io/post/fedora-8---the-comeback/My previous post about Ubuntu Gutsy vs Fedora 8 was weak. It is difficult to find a very good distro. Depending on the computer, I have had different experiences. On some computers, Ubuntu really shines and work with minimal tweaking. On some others, Ubuntu is unstable/does not handle wireless correctly and Fedora is much more stable.
The main issues I can see with Fedora 8 are:
LVM by default. I don’t think it is a good idea to go LVM by default since lots of basic tools are still not handling it properly.Haskell Fibonacci Revisited
https://chasethedevil.github.io/post/haskell-fibonacci-revisited/
Wed, 12 Dec 2007 17:08:00 +0000https://chasethedevil.github.io/post/haskell-fibonacci-revisited/Recently, there was an interesting post about Haskell performance and Haskell parallelization showing Haskell could outperform C on a simple Fibonacci example.
A friend of mine, Peter (that I seem to manage to constantly piss off) thought about it on another level, saying you could achieve a _MILLION_ times better using a direct formula in C or Java, the Binet formula.
I decided to try as the improvement scale seemed a bit surprising.Ubuntu 7.10 vs Fedora Core 8 - Gutsy vs Werewolf
https://chasethedevil.github.io/post/ubuntu-7.10-vs-fedora-core-8---gutsy-vs-werewolf/
Tue, 20 Nov 2007 16:23:00 +0000https://chasethedevil.github.io/post/ubuntu-7.10-vs-fedora-core-8---gutsy-vs-werewolf/I was pretty happy with Ubuntu 7.10, but when Fedora 8 came out I decided to give it a try. Last time I tried it it was Core 2 or something like that, and it was NOT good.
At first Fedora 8 looks quite good, has a good Live CD install, reminiscent of Ubuntu. The positive side is that it is based on the latest Kernel. It manages my Thinkpad T42 very well (suspend, hibernate work).Apache DbUtils Completely Useless
https://chasethedevil.github.io/post/apache-dbutils-completely-useless/
Fri, 02 Nov 2007 17:17:00 +0000https://chasethedevil.github.io/post/apache-dbutils-completely-useless/I am disappointed about the Jarkarta Commons DbUtils project. I give a link to it, because it’s a bad project (even if written in clean code). It is very simple, but it really does not do much for you.
I was looking for a very simple abstraction of JDBC. I thought bringing Spring in my project would be overkill. After trying DbUtils, I think again. It does not help. It does not handle frequent cases well, and it does not save many lines of code.I fell in the trap of Boolean.getBoolean()
https://chasethedevil.github.io/post/i-fell-in-the-trap-of-boolean.getboolean/
Fri, 12 Oct 2007 16:10:00 +0000https://chasethedevil.github.io/post/i-fell-in-the-trap-of-boolean.getboolean/I was struggling to find a bug in a very simple application, it ended up being something as simple as using the damned Boolean.getBoolean("true") call instead of Boolean.valueOf("true").booleanValue() call. The Boolean.getBoolean method is something you almost never need to use, as it checks if a particular system property is true or false. There is a similar method for Integer.getInteger, and a quick google search shows I am not the only one to think those method should never have been part of the basic API for Boolean/Integer.Fast Web Development With Scala
https://chasethedevil.github.io/post/fast-web-development-with-scala/
Tue, 25 Sep 2007 14:02:00 +0000https://chasethedevil.github.io/post/fast-web-development-with-scala/I am currently experimenting with Scala. It seems quite convenient for web applications. Using Tomcat, it is possible to have a very productive developer environment.
Here is a sample Embedded Tomcat you can start in a Scala project:
import java.io._;
import org.apache.catalina._;
import org.apache.catalina.startup._;
object TomcatScalaServer {
val CATALINAHOME : File = new File("../newsbeef.com");
val WEBAPPS : File = new File(CATALINAHOME,"webapps");
val ROOT : File = new File(CATALINAHOME,"web");
val HOSTNAME : String = "localhost";
val PORT : int = 8080;
def await() {
while( true ) {
try {
System.out.println("sleeping 100s");
Thread.sleep( 100000 );
} catch {
case ie : InterruptedException =>;
}
}
}
def start() {
val server = new Embedded();
server.setCatalinaHome(CATALINAHOME.getAbsolutePath());
val engine = server.createEngine();
engine.setDefaultHost(HOSTNAME);
val host = server.createHost(HOSTNAME, WEBAPPS.getAbsolutePath());
engine.addChild(host);
val context = server.createContext("", ROOT.getAbsolutePath());
context.setParentClassLoader(Thread.currentThread().getContextClassLoader());2 Months of Ubuntu on Mac Mini
https://chasethedevil.github.io/post/2-months-of-ubuntu-on-mac-mini/
Mon, 27 Aug 2007 23:48:00 +0000https://chasethedevil.github.io/post/2-months-of-ubuntu-on-mac-mini/I am finally happy with my OS. I had previously [some complaints]({{ relref . “1-year-of-mac-mini–the-deception-point.md” }}) about MacOs X and the Mac Mini. It is now over, with Ubuntu, I am very happy of my quiet system.
I use Quod Libet for Audio, it has similar interface as iTunes, with more features (ability to play most audio formats). I chose Quod Libet instead of the standard Rhythmbox because of its practical mp3 tags handling.Spring Web Services, Finally!
https://chasethedevil.github.io/post/spring-web-services-finally/
Thu, 23 Aug 2007 11:22:00 +0000https://chasethedevil.github.io/post/spring-web-services-finally/Spring Web Services seems to be the technology I have been looking for recently. I am not a Spring bigot (too XML oriented), but here the Spring folks have something right.
I used to work with Web Services the simple way: create a java class (or EJB), expose it as Web Service through Axis or RAD, generating the WSDL in the process. And then a client would just be the reverse, take the WSDL, use a tool (Axis or RAD) that creates client Java classes from it automatically.Original Pattern: ServletRequest in ThreadLocal
https://chasethedevil.github.io/post/original-pattern-servletrequest-in-threadlocal/
Thu, 02 Aug 2007 12:07:00 +0000https://chasethedevil.github.io/post/original-pattern-servletrequest-in-threadlocal/After seeing Scala had elements of Erlang through Actors, I decided to take a closer look at the language. There is an interesting new web framework in Scala, called Lift. One drawback of Lift is that it seems to be very cutting edge and not that easy to grasp. While reading its source code, I stumbled upon a strange pattern: Storing the ServletRequest in a ThreadLocal.
I had not seen that before, and was wondering why one would do such a thing.Vim setup
https://chasethedevil.github.io/post/vim-setup/
Fri, 27 Jul 2007 16:13:00 +0000https://chasethedevil.github.io/post/vim-setup/Here is my Vim setup information for reference
in .vimrc or _vimrc, add at the beginning:
set langmenu=en_US.ISO_8859-1
set gfn=Bitstream_Vera_Sans_Mono:h9:cANSI
colorscheme oceandeep
First line is to avoid menus in French.
The font (you can find here) is simply the best programmer's font.
oceandeep mode can be found here .Why Eclipse Is Better
https://chasethedevil.github.io/post/why-eclipse-is-better/
Fri, 27 Jul 2007 14:37:00 +0000https://chasethedevil.github.io/post/why-eclipse-is-better/Initially I adopted Eclipse instead of Emacs because it was more powerful to search code, and it allowed refactoring. I regularly tried other IDEs but always end up back to Eclipse, even though there has been less big improvements in Eclipse in the past years (but lots of small ones).
I just saw today that Eclipse allowed programmatic refactoring. Now that’s something quite amazing, and I don’t think other IDEs do that yet.Tapestry5 vs Wicket: 1 - 0
https://chasethedevil.github.io/post/tapestry5-vs-wicket-1---0/
Wed, 11 Jul 2007 12:49:00 +0000https://chasethedevil.github.io/post/tapestry5-vs-wicket-1---0/Getting started with Tapestry 5 is easier than with Wicket 1.3. Some readers will complain that it is again the view of someone who has no deep knowledge of either Tapestry or Wicket. But I think it is important for projects to be easily accessible to developers. Wicket seems to have more buzz around these days, and has a detailed wiki with plenty of useful information in it. But that's the problem I see with Wicket, it is not simple to do simple things, that is why there is so much information to do simple things in the Wicket wiki.NetBeans 6.0M10 out without announcement yet!
https://chasethedevil.github.io/post/netbeans-6.0m10-out-without-announcement-yet/
Sat, 30 Jun 2007 07:15:00 +0000https://chasethedevil.github.io/post/netbeans-6.0m10-out-without-announcement-yet/I just found it while browsing netbeans website, here is the link. Netbeans is starting to be much more interesting that it used to be before 5.5, even though shortcuts are a pain, because so different from most other editors, and not always defined for important tasks. I like the all integrated feeling without plugin and slugishness by default.Use ORM For Better Performance
https://chasethedevil.github.io/post/use-orm-for-better-performance/
Tue, 12 Jun 2007 12:59:00 +0000https://chasethedevil.github.io/post/use-orm-for-better-performance/This is not something I would have though a few years ago. It is something I learnt after working on many different projects, some using an ORM layer like Hibernate, Entity EJBs, or JDO, some using JDBC approach via Spring Templates or custom frameworks. Many projects that use ORM have performance problems, that don't seem that common with projects using JDBC. But the size of the database model of ORM projects is often much bigger than the one of JDBC projects (which actually makes sense).People Using Spring, EJBs Don't Know Basic JDBC
https://chasethedevil.github.io/post/people-using-spring-ejbs-dont-know-basic-jdbc/
Wed, 30 May 2007 12:03:00 +0000https://chasethedevil.github.io/post/people-using-spring-ejbs-dont-know-basic-jdbc/I recently found a bug in software we are developing. I traced it and found the root was improper JDBC handling. The application is written using EJBs, Spring and plenty of other relatively complex technologies. I was surprised that developers who were able to use all those technologies had no understanding of basic JDBC.
They fetched all the data (including double, decimal numbers) from the database as String using rs.getString() !Wizards Bad For Productivity
https://chasethedevil.github.io/post/wizards-bad-for-productivity/
Wed, 16 May 2007 14:56:00 +0000https://chasethedevil.github.io/post/wizards-bad-for-productivity/IBM RAD comes with many wizards, to create EJBs, to create Web Services, do struts mapping… They are quite well done, making EJB < 3.0 usable, and Web Services look simple.
But wizards sucks at:
typos correction repetition But when you do a typo in your wizards, then all the files generated/changed are wrong, and you don’t necessarily know if you can just do a search and replace. Plus you don’t necessarily know all the files that were affected by the typo.Less Productive With Maven2.
https://chasethedevil.github.io/post/less-productive-with-maven2./
Sun, 29 Apr 2007 17:10:00 +0000https://chasethedevil.github.io/post/less-productive-with-maven2./My first trials of Maven were failures. As I am stubborn, I tried again, on a new project, a quite simple one. It works, but it makes some easy things overkill. And the default way of using it makes a developer lose lots of time.
If I have a project with common classes, a standalone app, and a web app, then logically you do 3 projects, 2 of them depending on the common one.How to Build Good Software? Good network connection
https://chasethedevil.github.io/post/how-to-build-good-software-good-network-connection/
Fri, 27 Apr 2007 12:40:00 +0000https://chasethedevil.github.io/post/how-to-build-good-software-good-network-connection/Not having good internet connection can be problematic to download new libraries, read or search for documentation on development subjects. But not having a good internal network connection is killer of productivity. It means sometimes not being able to access integration, preprod or even production environment, or ssh session not responding in the middle of an action. As software makes an increasing use of the network, it means not being able to test or to use correctly all kind of software.How to Build Good Software? Private office, again
https://chasethedevil.github.io/post/how-to-build-good-software-private-office-again/
Wed, 25 Apr 2007 15:01:00 +0000https://chasethedevil.github.io/post/how-to-build-good-software-private-office-again/Apparently it’s more a habit of French companies to have big open spaces with no separation at all between people. There is nothing more annoying than having people in conference call in front of you while you are trying to work on something completely different. French people forgot the cubicle part in the American open space idea. So sometimes the room is just a big mess, everybody being able to disturb you anytime.How to Build Good Software? Welcome newcomers
https://chasethedevil.github.io/post/how-to-build-good-software-welcome-newcomers/
Wed, 18 Apr 2007 20:17:00 +0000https://chasethedevil.github.io/post/how-to-build-good-software-welcome-newcomers/Some companies do it naturally, some really don’t. In small companies, it is almost natural, people will make a newcomer productive very quickly. In a big company it’s not the same game.
Some important points are:
Computer ready the first day, well sized (right ram, right power, developers are not MS office users), right OS. I had experience with having not the right amount of ram, not the right version of OS, not the right user rights to install and use critical software for my work, and all those were known from the team.Project Estimations And Fibonacci Sequence.
https://chasethedevil.github.io/post/project-estimations-and-fibonacci-sequence./
Fri, 13 Apr 2007 13:01:00 +0000https://chasethedevil.github.io/post/project-estimations-and-fibonacci-sequence./I was recently in a meeting where use case complexity was estimated using numbers in the Fibonacci sequence. I was surprised by the choice of the Fibonacci sequence. Why not any sequence? Why a particular one? I googled and found the culprit, Mr Mike Cohn in his book Agile Estimating and Planning. It’s actually not a bad sequence to choose, since the scale is increasing constantly, so by picking up numbers in this sequence, you can quite accurately describe estimation.How to Build Good Software? Use a bug management software, really.
https://chasethedevil.github.io/post/how-to-build-good-software-use-a-bug-management-software-really./
Fri, 13 Apr 2007 10:56:00 +0000https://chasethedevil.github.io/post/how-to-build-good-software-use-a-bug-management-software-really./This will seem obvious, unfortunately, when people are involved, nothing is that obvious. It’s not because you setup a bug/feature management software that people will use it. You have to force people to go through the bug management software each time they want something fixed. If you don’t do that some people will keep sending incomplete mails, or worse call you to get something fixed, that will be forgotten in a week.How to Build Good Software? Have a good build process
https://chasethedevil.github.io/post/how-to-build-good-software-have-a-good-build-process/
Thu, 12 Apr 2007 09:54:00 +0000https://chasethedevil.github.io/post/how-to-build-good-software-have-a-good-build-process/Important points are: standard code hierarchy, automatic download of dependencies, a distribution command with versioning support and source control interaction, a simple command to build each part of the project. In Java best candidates are a sophiticated ant build, or maven2. Maven2 is quite good since it forces you to do some of those steps, even though I think ant can’t really be avoided for many more specific tasks.
Once, I got wrong code before I left for a customer site, because code given to the customer was not checked into a source repository everytime before it was given to the customer.How to Build Good Software? Private Office
https://chasethedevil.github.io/post/how-to-build-good-software-private-office/
Wed, 11 Apr 2007 10:52:00 +0000https://chasethedevil.github.io/post/how-to-build-good-software-private-office/In an open space, people keep on coming to discuss various issues with various people, issues that have nothing to do with your work. You end up either being distracted, or annoyed by the increased noise level.
Apparently at Microsoft, they have private offices for each programmer. It might be extreme, paradoxally not in the XP (extreme programming) sense, but it is much better than open space for productivity. In XP, it’s almost the opposite with 2 developers working often together.How to Build Good Software? Lay Off Quickly.
https://chasethedevil.github.io/post/how-to-build-good-software-lay-off-quickly./
Tue, 10 Apr 2007 11:12:00 +0000https://chasethedevil.github.io/post/how-to-build-good-software-lay-off-quickly./If you have to lay off in your job, do it quickly. I don’t understand companies that want to keep someone as long as legally possible when this someone wants to leave. First the employee won’t be as motivated, but more importantly, you will continue to train that person to your company’s software and ways of work. This would be much better used on another person, that will stay in the company.How to Build Good Software? Talk to people, especially the ones you don't know well.
https://chasethedevil.github.io/post/how-to-build-good-software-talk-to-people-especially-the-ones-you-dont-know-well./
Fri, 06 Apr 2007 17:02:00 +0000https://chasethedevil.github.io/post/how-to-build-good-software-talk-to-people-especially-the-ones-you-dont-know-well./Someone modified a simple launch script on a integration machine. This pissed off the author of the script. Why?
Just because the guy who modified the script never worked before with the author of the script. If only the author had been notified verbally or by mail of the modification, he would have been happy. Furthermore this would increase the quality of the change since the new guy might have made a change that has other impacts, that the author will best evaluate quickly.Find Grep And Vi Keys Small Memo
https://chasethedevil.github.io/post/find-grep-and-vi-keys-small-memo/
Thu, 05 Apr 2007 18:48:00 +0000https://chasethedevil.github.io/post/find-grep-and-vi-keys-small-memo/I tend to forget this now and then to grep on a specific list of files:
find . -name "*.xml" | xargs grep "iwantthis"
And I also tend to forget the vi keys. Small extract:
h - move left one character
j - move down one line
k - move up
l - move right
$ - go to the end of the current line
0 - go to the beginning of the current lineHow to Build Good Software? MS Press Code Complete says Measure twice, cut once
https://chasethedevil.github.io/post/how-to-build-good-software-ms-press-code-complete-says-measure-twice-cut-once/
Thu, 05 Apr 2007 14:14:00 +0000https://chasethedevil.github.io/post/how-to-build-good-software-ms-press-code-complete-says-measure-twice-cut-once/I am starting a series of posts about software construction, based on good and bad experiences while working for my many employers.
“Software construction (a.k.a. architecture), is the only activity that’s guaranteed to happen on every project”. It is not rare that projects or new features are abandoned either because they are too costly, or because they are not needed anymore, or because they are other more important priorities.
In the same vein: “Measure twice, cut once”.Java Concurrency In Practice Book Review
https://chasethedevil.github.io/post/java-concurrency-in-practice-book-review/
Wed, 14 Feb 2007 16:33:00 +0000https://chasethedevil.github.io/post/java-concurrency-in-practice-book-review/My reference book on Java concurrency is Doug Lea's Concurrent Programming in Java: Design Principles and Patterns. He is one of the authors of this new book, Java Concurrency In Practice. There is also Joshua Bloch, author of Effective Java, that many people love (but I am less a fan of it, even if I would recommend it to Java newbies), and author of Java Puzzlers, that I found more fun.Why are you not using Entity EJB 1.1?
https://chasethedevil.github.io/post/why-are-you-not-using-entity-ejb-1.1/
Wed, 07 Feb 2007 16:38:00 +0000https://chasethedevil.github.io/post/why-are-you-not-using-entity-ejb-1.1/I am currently quite busy learning about Websphere Commerce. I was surprised to notice that they still use Entity EJBs 1.1. My experience was that many companies turned away from Entity EJBs, sometimes from the beginning, preferring TopLink or Hibernate (later).
I know that Entity EJBs are more heavy to use than Hibernate, but with the proper tooling support, it’s not really a big issue. Are there more fundamental reasons? There are probably some mapping limitations, but IBM implementation is apparently quite good in term of features.Switching to Windows
https://chasethedevil.github.io/post/switching-to-windows/
Thu, 25 Jan 2007 01:04:00 +0000https://chasethedevil.github.io/post/switching-to-windows/That’s it, I have done it, the unthinkable. I have switched from MacOs X to Windows XP. My idea was first to install Ubuntu on the Mac Mini, but if you want to keep the Mac Os X install, the methods I have read on the web required to use bootcamp. At around the same time I was annoyed by problems I had with bluetooth and Skype in MacOs.
So, with bootcamp installed I decided to give a try to Windows.Social (Web) Revelation: Tags Are Lame
https://chasethedevil.github.io/post/social-web-revelation-tags-are-lame/
Tue, 16 Jan 2007 10:26:00 +0000https://chasethedevil.github.io/post/social-web-revelation-tags-are-lame/I had a revelation yesterday while thinking about del.icio.us, the most well known social bookmarks site. I find out that I almost never use my tags, and I am often not satisfied by results when I search using tags. What use can you make of 100s of tags? in the end only less than 10 are usable to classify very different stuff. And even then compared to a search it’s not a much useful classification.1 year of mac mini - the deception point
https://chasethedevil.github.io/post/1-year-of-mac-mini---the-deception-point/
Mon, 08 Jan 2007 15:56:00 +0000https://chasethedevil.github.io/post/1-year-of-mac-mini---the-deception-point/I am less enthusiastic about the Apple experience than I was one year ago. I am quite enthusiastic with the hardware in general, except the keyboard. The computer is small and quiet, and there are not many competitors at this price on the market.
Experience as a developer
I feel frustrated with MacOs X as a development environment, when compared with Ubuntu Linux. I always miss the multiple desktop, despite expose magnificient look.Tired Of Bad Singletons
https://chasethedevil.github.io/post/tired-of-bad-singletons/
Thu, 04 Jan 2007 11:50:00 +0000https://chasethedevil.github.io/post/tired-of-bad-singletons/While looking through some code for a project, I saw that:
public static final ProductYP instance = new ProductYP(); public ProductYP()
{
if (instance != null)
throw new RuntimeException("Only one instance allowed");
prods = new HashMap();
}
public static ProductYP getInstance() {
return instance;
}
And I don't think it was done by a newbie... It's actually not far from being correct, it's just that the guy obviously does not know about private constructors.Declaring Your Logger - No Problem
https://chasethedevil.github.io/post/declaring-your-logger---no-problem/
Fri, 29 Dec 2006 11:45:00 +0000https://chasethedevil.github.io/post/declaring-your-logger---no-problem/I used to like the java specialists newsletter, most news used to be a bit challenging. Nowadays however the quality is lower. In the latest news, the author proposes to use the StackTrace to get the class name, in order to declare a Logger independently of any explicit reference to the class name.
While this is a clever hack, it still requires some code to be duplicated in every class, compared to Aspect/IoC approach.Very Quick Django Trial -> Bye Bye Django
https://chasethedevil.github.io/post/very-quick-django-trial---bye-bye-django/
Thu, 21 Dec 2006 17:48:00 +0000https://chasethedevil.github.io/post/very-quick-django-trial---bye-bye-django/I tried a bit django for one very simple thing, where django is not of much use, but it was a way to try it with something else than examples on the site. Even if django templates features seem very good and very convenient when reading the docs (for example the extends keyword), I found out that the template system is very annoying. Firstly one has to learn another templating system.A Proof That JavaScript Sucks.
https://chasethedevil.github.io/post/a-proof-that-javascript-sucks./
Fri, 15 Dec 2006 16:51:00 +0000https://chasethedevil.github.io/post/a-proof-that-javascript-sucks./Google developed GWT.
Why would GWT be so well acclaimed if JavaScript was a good language. When you talk about GWT to someone (a developer preferably), the first reaction is often
great I don’t need to do any JavaScript
I recently discovered another similar open source project, ZK. The first thing you can read on the website is
ZK is an open source Ajax Web framework that enables rich user interface for web applications with no JavaScript and little programming.Building With Ant + Maven Antlib?
https://chasethedevil.github.io/post/building-with-ant--maven-antlib/
Thu, 14 Dec 2006 10:51:00 +0000https://chasethedevil.github.io/post/building-with-ant--maven-antlib/I discovered a new baby in the build world. Some open source projects use a combination of ant and maven. I thought you could vaguely use ant from maven. But I did not know of Maven Antlib that allows you to use maven2 from Ant. Why would you use Maven2 from Ant?
because Maven2 requires to adapt your project to its standard hierarchy, or to have excellent Maven2 skills to create your own archetype for each existing project.The Hibernate Network Proxy, A Dumb Idea.
https://chasethedevil.github.io/post/the-hibernate-network-proxy-a-dumb-idea./
Mon, 04 Dec 2006 14:41:00 +0000https://chasethedevil.github.io/post/the-hibernate-network-proxy-a-dumb-idea./A friend of mine had a good idea for a Java project named “hibernate proxy”. I renamed it “hibernate network proxy” because hibernate proxies are already a well known concept among hibernate users (it allows lazy loading through a Java Proxy class).
The hibernate network proxy, is a way to use hibernate remotely, that is to proxy hibernate calls through TCP (or even HTTP) to another machine, that will execute the session.Workaround When Eclipse Fucks Off With CVS
https://chasethedevil.github.io/post/workaround-when-eclipse-fucks-off-with-cvs/
Tue, 28 Nov 2006 11:42:00 +0000https://chasethedevil.github.io/post/workaround-when-eclipse-fucks-off-with-cvs/Until recently, I always found Eclipse CVS support to be excellent. The synchronize view was really a big plus to do clean commits, without forgetting any file.
But I have encountered several problem with Eclipse 3.2+:
On one project, it keeps putting the build directory into CVS, and I can't find how to change that setting. Each time I open the project I have to change the CVS/Entries file.Maven: Game Over, Try Again
https://chasethedevil.github.io/post/maven-game-over-try-again/
Fri, 24 Nov 2006 17:51:00 +0000https://chasethedevil.github.io/post/maven-game-over-try-again/I am writing only as a newbie on Maven2. I tried to use it several times on small projects, but each time I found out that the time involved to make it work with an existing project was too much a pain in the a**. When confronted to very simple hierarchies that are not the standard of the documentation, I was a bit lost on how to arrange things, except changing the whole hierarchy to adapt to Maven.How JDepend Changed My Java Packaging
https://chasethedevil.github.io/post/how-jdepend-changed-my-java-packaging/
Fri, 13 Oct 2006 09:27:00 +0000https://chasethedevil.github.io/post/how-jdepend-changed-my-java-packaging/One important feature of Java language is the package keyword. It helps a lot in modularizing your code. But how exactly one should use it is not that clear.
I have been on projects where 100s of classes are in a same package and more often where you have packages for every 2 classes. Often, packages are chosen so as to split functionalities. But often as well, people are packages maniacs and create way too many of them, because they want to sort things out, not necessarily applying a consistent logic.You Know IOException? Think Again!
https://chasethedevil.github.io/post/you-know-ioexception-think-again/
Thu, 14 Sep 2006 10:59:00 +0000https://chasethedevil.github.io/post/you-know-ioexception-think-again/I was amazed today to find out that there was no constructor IOException(String, Throwable) or IOException(Throwable) in JDK1.4 and JDK1.5. It is finally in JDK1.6, I can’t believe it took Sun that much time to change that.
So the workaround is:
`IOException ioe = new IOException("message");` `ioe.initCause(e);` `throw ioe;` It can also be written as:
`throw (IOException) new IOException("message").initCause(e);` It is not a major problem, but still. We can all thank the guy who reported that as a bug to Sun in 2004.Good Software Books - 2006 version
https://chasethedevil.github.io/post/good-software-books---2006-version/
Mon, 11 Sep 2006 14:27:00 +0000https://chasethedevil.github.io/post/good-software-books---2006-version/Here is an update of the most interesting software books I found interesting. I already made such a list in 2005:
Object Oriented Software Construction, 2nd Ed, by Bertrand Meyer. This made me understand why OOP is important, what is important in OOP and why it is still relevant. It contains lots of important guidelines you can apply to better design programs. One famous quote is "Real systems have no top"I Get Spring
https://chasethedevil.github.io/post/i-get-spring/
Wed, 23 Aug 2006 18:04:00 +0000https://chasethedevil.github.io/post/i-get-spring/When you google up Java Spring, one of the best results is a post from crazybob called “I Don’t Get Spring”. For a long time, I shared a similar opinion. But now that I have used it, I get it. I only use it for defining replaceable services, so when I talk about Spring, I mean spring-core and spring-beans.
These two packages are not big, and have only very few dependencies.Java Serialization vs .NET Serialization - Java Perverse?
https://chasethedevil.github.io/post/java-serialization-vs-.net-serialization---java-perverse/
Tue, 22 Aug 2006 12:55:00 +0000https://chasethedevil.github.io/post/java-serialization-vs-.net-serialization---java-perverse/Did you know what happens in Java when you serialize a subclass of a non serializable class? I was surprised by the answer: it works!
Unfortunately it is not a good thing, because it will serialize fields from your subclass and no fields from the parent class. So you'll end up with a half serialized instance.
In .NET, it breaks at runtime, throwing an exception, which is I think, much more logical, because then you don't end up with half data somewhere.5 Minutes of Google Spreadsheets
https://chasethedevil.github.io/post/5-minutes-of-google-spreadsheets/
Thu, 17 Aug 2006 12:10:00 +0000https://chasethedevil.github.io/post/5-minutes-of-google-spreadsheets/Today I noticed a Google Spreadsheets link in my gmail screen. I had read about it but never bothered to try before. In the finance industry, a lot of traders use excel, so I was wondering if Google spreadsheets could be another fit.
Unfortunately for Google, under Linux at least, I don’t find Google Spreadsheets usable for anything else than storing and sharing some information, not often updated. Although I admire the engineers that managed to write the Javascript behind Google Spreasheet, it is way too slow for using it in interesting ways.Procedural Programming in an OO language
https://chasethedevil.github.io/post/procedural-programming-in-an-oo-language/
Tue, 08 Aug 2006 12:35:00 +0000https://chasethedevil.github.io/post/procedural-programming-in-an-oo-language/OO is an old buzzword, that is not required anymore to get an employment. Recruiter seems to prefer SOA, Web Services, and in France, “mutualisation” and “urbanisation”. Sometimes I really wonder if OO made it.
I am sure many of you are confronted with programmers that love procedural programming in many of your projects. They might use an OO language but in the end will organize everything by “type”, split invariably state and logic.Back To Real Java, Bye Bye J2EE
https://chasethedevil.github.io/post/back-to-real-java-bye-bye-j2ee/
Wed, 26 Jul 2006 16:26:00 +0000https://chasethedevil.github.io/post/back-to-real-java-bye-bye-j2ee/I changed job recently. In this new job, it is refreshing to see Java used like in the old days, without the J2EE layers, and without the extra IBM layers of my previous job. Granted, the fresh Java approach does not apply to many projects, because a lot of apps are just about interfacing a database with a web interface. But Spring success showed that even for many of those projects, fresh Java approach with a small framework is enough.Moving weekly Javablog stats to a new blog
https://chasethedevil.github.io/post/moving-weekly-javablog-stats-to-a-new-blog/
Mon, 26 Jun 2006 17:25:00 +0000https://chasethedevil.github.io/post/moving-weekly-javablog-stats-to-a-new-blog/Javablogs.com top 10 weekly/monthly/yearly entries were starting to pollute my blog too much for my taste. It is more appropriate to dedicate a blog to them. That is what I should have done in the first place as it is very easy to have many blogs with blogger.com.
So you’ll find at javabuzz.blogspot.com the weekly top 10 most read entries on Javablogs, and sometimes more.JSF Was Too Hard for Experienced Developers
https://chasethedevil.github.io/post/jsf-was-too-hard-for-experienced-developers/
Fri, 23 Jun 2006 14:59:00 +0000https://chasethedevil.github.io/post/jsf-was-too-hard-for-experienced-developers/While starting to look into Seam, I noticed that all examples use JSF for the view, and there is no alternative to it. If someone like Gavin (from Hibernate fame) thinks JSF is usable, then I probably overlooked something when I looked into it a few years ago, when JSF was the craze of the moment.
At the beginning, JSF looks very similar to ASP.NET. But I have a small experience with ASP.Top 10 Most Read Last Week On Javablogs.com, Week 24
https://chasethedevil.github.io/post/top-10-most-read-last-week-on-javablogs.com-week-24/
Mon, 19 Jun 2006 13:05:00 +0000https://chasethedevil.github.io/post/top-10-most-read-last-week-on-javablogs.com-week-24/Most read last week
Sexiest photo ever (235): Heading off to Nerja (on the advice of Joe who will pay dearly if the ratio of fish 'n chip shops to tapas bars isn't on the right side of 95:05) for 2 weeks with 3 lovely girls and a... [read] You are not a ‘real’ Java developer until… (217): You had to use JDK 1.3 on a real project. In 2006.On EJB Restrictions - Can You Open a Socket?
https://chasethedevil.github.io/post/on-ejb-restrictions---can-you-open-a-socket/
Mon, 19 Jun 2006 11:48:00 +0000https://chasethedevil.github.io/post/on-ejb-restrictions---can-you-open-a-socket/During job interviews, one of the frequent questions is
“What restrictions are imposed on EJBs?”.
I had a chat recently with someone about it, and we still don’t agree on the answer.
He believes we can’t open sockets, while I believe it is perfectly allowed, if you don’t retain the socket connection between method calls. His arguments are based on an analogy with files. After all in Linux, files are sockets.Top 10 Most Read Last Week On Javablogs.com, Week 23
https://chasethedevil.github.io/post/top-10-most-read-last-week-on-javablogs.com-week-23/
Mon, 12 Jun 2006 16:37:00 +0000https://chasethedevil.github.io/post/top-10-most-read-last-week-on-javablogs.com-week-23/Most read last week
The Top 10 Java Killer Apps (357): Some VERY cool apps that have created, or are creating, quite a buzz not only in the Java world but in the larger populace. I’ve used most of the apps below, although I have yet to try a few. [read] Google hits a home run with Google Spreadsheet (290): I just got my invite to play with the latest offering from Google, the Google Spreadsheets and my initial reaction after playing with it for the past hour is incredibly positive.Non Blocking with Traditional Java IO - On the Use of InputStream.available() and Thread.sleep()
https://chasethedevil.github.io/post/non-blocking-with-traditional-java-io---on-the-use-of-inputstream.available-and-thread.sleep/
Thu, 08 Jun 2006 16:31:00 +0000https://chasethedevil.github.io/post/non-blocking-with-traditional-java-io---on-the-use-of-inputstream.available-and-thread.sleep/Some time ago I did quite a lot of IO in Java and I yet did not see this way of reading a InputStream from a Socket:
InputStream in=channel.getInputStream();
channel.connect();
byte[] tmp=new byte[1024];
while(true){
while(in.available()>0){
int i=in.read(tmp, 0, 1024);
if(i<0)break;
System.out.print(new String(tmp, 0, i));
}
if(channel.isClosed()){
System.out.println("exit-status: "+channel.getExitStatus());
break;
}
try{Thread.sleep(1000);}catch(Exception ee){}
}
channel.disconnect(); This comes from a piece of code from an example of JSch , a good ssh client in java. A work collegue had the bad idea to remove the Thread.Top 10 Most Read Last Week On Javablogs.com, Week 22
https://chasethedevil.github.io/post/top-10-most-read-last-week-on-javablogs.com-week-22/
Mon, 05 Jun 2006 14:07:00 +0000https://chasethedevil.github.io/post/top-10-most-read-last-week-on-javablogs.com-week-22/Most read last week
Why I'm leaving Sun and... what next? (304): Leaving Sun is possibly one of the most difficult decisions I've ever made. But I think it's time for me to start new things and, well, it's also time for Sun to start new things. [read] 9 new and *noteworthy* features in Eclipse 3.2 (280): Chris Laffra has put a big presentation of all the new and noteworthy features that are coming in the Eclipse 3.Is Java Flawed - a big advantage of Python/Ruby/(your favorite interpreted language)
https://chasethedevil.github.io/post/is-java-flawed---a-big-advantage-of-pythonrubyyour-favorite-interpreted-language/
Fri, 02 Jun 2006 17:33:00 +0000https://chasethedevil.github.io/post/is-java-flawed---a-big-advantage-of-pythonrubyyour-favorite-interpreted-language/Java is supposed to be much better to build big projects, because of static type checking, and all the rigour around the language. But how many of you have seen medium sized projects taking more than 30 minutes to build.
At work, they have a standard J2EE project, with only about 50 EJBs, hundreds of JDO classes, and standard classes. Between the JDO generation, EJB generation, EJB dependencies calculations, and packaging, it takes 20 minutes.Using Linux to Recover Fucked Up Windows Data
https://chasethedevil.github.io/post/using-linux-to-recover-fucked-up-windows-data/
Thu, 01 Jun 2006 01:52:00 +0000https://chasethedevil.github.io/post/using-linux-to-recover-fucked-up-windows-data/Recently, one of my relatives computer under Windows XP, refused to boot. There was no way of fixing it with Windows Install CD as partition table seemed corrupt to Windows. I tried everything in an 2003 Ultimate Boot CD, but nothing worked out.
Someone gave me an install cd of Ubuntu Linux, and it managed to read the data. Well sometimes only. The erratic behaviour was due to a bad ATA cable.Java HTML Parsing Example With htmlparser
https://chasethedevil.github.io/post/java-html-parsing-example-with-htmlparser/
Tue, 30 May 2006 11:02:00 +0000https://chasethedevil.github.io/post/java-html-parsing-example-with-htmlparser/Every week, I post javablogs top 10 most read blog entries on this blog. The reason for it was that I don't look at what's happening on the week-end and this will pickup interesting stories from the weekend, and I also don't watch javablogs everyday. Overall I find it quite good to be uptodate with interesting stuff happening on javablogs.
As mentionned in an earlier post my library of choice to do the parsing is htmlparser (on sourceforge) because it's free, open source and because I am lazy and did not want to do my own.Top 10 Most Read Last Week On Javablogs.com, Week 21
https://chasethedevil.github.io/post/top-10-most-read-last-week-on-javablogs.com-week-21/
Tue, 30 May 2006 10:12:00 +0000https://chasethedevil.github.io/post/top-10-most-read-last-week-on-javablogs.com-week-21/Most read last week Spring vs JBoss, and why I don’t care about Sun standards (272): After a long time, it was interesting to see the Spring and JBoss folks engage in a public war of words, in comments on Matt Raible’s blog. [read] Kent Beck: "We thought we were just programming on an airplane" (231): JUnit co-creator Kent Beck says a number of things convinced he and Erich Gamma to create a new revision of JUnit after a long hiatus, including TestNG and Java 5.Top 10 Most Read Last Week On Javablogs.com, Week 20
https://chasethedevil.github.io/post/top-10-most-read-last-week-on-javablogs.com-week-20/
Mon, 22 May 2006 16:17:00 +0000https://chasethedevil.github.io/post/top-10-most-read-last-week-on-javablogs.com-week-20/Most read last week
The Worst Java Job Interview Questions. (269): Why are you looking for a job? Strictly speaking, this is not a java question, but it shows up in almost every job interview I've been to. [read] Goodbye Ant , Welcome Maven 2 (219): After years of using Ant for building my applications, I have moved to something different, Apache Maven 2. And now it seems there is no looking back.Top 10 Most Read Last Week On Javablogs.com, Week 19
https://chasethedevil.github.io/post/top-10-most-read-last-week-on-javablogs.com-week-19/
Tue, 16 May 2006 10:29:00 +0000https://chasethedevil.github.io/post/top-10-most-read-last-week-on-javablogs.com-week-19/Most read last week
Axis2: Why bother? (257): The Axis team is kicking up a big fuss about their recent release of Axis 2 (1.0!) Surprisingly, this library is so so abysmally bad, [read] Google trends proves: Java is doomed (251): Google trends is a nice idea, and I had to apply it adhoc to Java, Ruby, Python and C#. Interesting results, I can see a decline in Java! [read] Rich Open Source Webmail that doesn't suck (219): Guys.First Steps With EhCache
https://chasethedevil.github.io/post/first-steps-with-ehcache/
Thu, 04 May 2006 18:10:00 +0000https://chasethedevil.github.io/post/first-steps-with-ehcache/If you need to cache objects in your system, Ehcache is a simple cache written in Java, widely used and well tested. I will present here a short tutorial on how to use EhCache for people who don't want to look around the documentation at first, but just want to test if it works in their project and to see how easy it is to setup. Installation Download Ehcache from the Download link on http://ehcache.Null vs. Errors
https://chasethedevil.github.io/post/null-vs.-errors/
Wed, 26 Apr 2006 16:16:00 +0000https://chasethedevil.github.io/post/null-vs.-errors/I am not particularly a fan of JCS (Jakarta Cache System) as I find ehcache code very clean and simple. But I have to say the author has some good comments on the site: Nulls vs. Errors I started to support ObjectNotFoundExceptions for failed gets but the overhead and cumbersome coding needed to surround a simple get method is ridiculous. Instead the JCS return null. For having seen too many times the ObjectNotFoundException "pattern", I can only agree!Algorithms in Java (Third Edition) Book Review
https://chasethedevil.github.io/post/algorithms-in-java-third-edition-book-review/
Wed, 26 Apr 2006 12:26:00 +0000https://chasethedevil.github.io/post/algorithms-in-java-third-edition-book-review/The book Algorithms in Java is huge, but unlike the usual huge books, the content is very interesting. It can be used as reference material, or as toilet book (to learn things while you're wasting time in the toilets).
You will learn simple things, like what is the "raison d'être" of linked lists. The author gives very good examples to illustrate his propositions. He explains through the sieve of erathostene and through Josephus problem the advantages of arrays or linked list.Caching HTTP Responses in Java
https://chasethedevil.github.io/post/caching-http-responses-in-java/
Wed, 19 Apr 2006 18:14:00 +0000https://chasethedevil.github.io/post/caching-http-responses-in-java/Caching HTTP response can dramatically improve performance of your app if what you generate is in reality not very dynamic. There are many free caching frameworks in Java. Most popular seem to be ehcache, oscache, jcs and JBoss Cache.
ehcache is quite simple to use and its code is clean. They have a CachingFilter that you can put in your webapp server to cache transparently HTTP responses. However as the framework only allows you to store Objects (which makes sense for most uses), I was wondering how they cached the HttpResponse which is a stream.Javablogs.com 2005 Top 20
https://chasethedevil.github.io/post/javablogs.com-2005-top-20/
Tue, 18 Apr 2006 16:42:00 +0000https://chasethedevil.github.io/post/javablogs.com-2005-top-20/Most read in 2005
New in Hibernate 3: Criteria API enhancements (816): Projection, aggregation, subselects, detatched criterias - its all there in the Hibernate 3 Criteria API. Let me show you some examples, starting with the new projection API.… [read] Hello, IDEA! (555): From the recent Java IDE discussions, it seems like there's a good portion of Java programmers who don't know IntelliJ IDEA, or simply haven't tried it yet.How To Use Java With Blogger: A Tutorial
https://chasethedevil.github.io/post/how-to-use-java-with-blogger-a-tutorial/
Tue, 18 Apr 2006 16:36:00 +0000https://chasethedevil.github.io/post/how-to-use-java-with-blogger-a-tutorial/Blogger has a REST API. I use it to retrieve particular posts or to post transformed data. There is no Java API that I know of, but you will see here it is not very difficult to interface with Blogger API in Java using plain old XML. Using libraries commons-httpclient and DOM4J it would be quite easy to implement your own Java Blogger API as the following code will suggest.Last week Javablogs.com top 10
https://chasethedevil.github.io/post/last-week-javablogs.com-top-10/
Tue, 18 Apr 2006 11:02:00 +0000https://chasethedevil.github.io/post/last-week-javablogs.com-top-10/Most read last week
Stupid Command Prompt Tricks (289): These Stupid (Windows) Command Prompt Tricks actually look rather useful. [read] The truth about Tudu Lists!! (260): I've now been working on Tudu Lists for more than one year, and I'm releasing today version 1.1. With this latest release, it is now time for me to tell the truth about Tudu Lists.… [read] Toplink vs hibernate (258): I still remember the excitement I felt when I started working on Toplink.Web Services No Better Than CORBA?
https://chasethedevil.github.io/post/web-services-no-better-than-corba/
Mon, 10 Apr 2006 15:23:00 +0000https://chasethedevil.github.io/post/web-services-no-better-than-corba/Richard Monson-Haefel (RMH), author of the famous Enterprise Java Beans (O'Reilly) and of a Web Services book is making an alarming claim about JAX-WS, the new Java web services standard: JAX-WS still sucks! In an effort to write a client to real world web services (for Google, Amazon, Ebay), he mostly failed. Errors seem to be largely related to WSDL to Java conversion. Jason Green, a JBoss developer, managed to get quickly a web service working for Ebay, but analysis by RMH suggest that hundreds of classes were generated for this simple one method web service.Is your UML Composition French or American?
https://chasethedevil.github.io/post/is-your-uml-composition-french-or-american/
Fri, 07 Apr 2006 11:40:00 +0000https://chasethedevil.github.io/post/is-your-uml-composition-french-or-american/The French Way
In many French books/lessons (a lesson here, another from caen university , one from UQAM), UML composition does not seem to mean the same as their English counterparts. They write:
Si l'agrégat est détruit (ou copié), ses composants le sont aussi.or les composants (en tant qu'ils sont composants) ont une durée de vie incluse dans celle de leur composé.
translated to English:
If the aggregate is destroyed (or copied), its components are destroyed (or copied) as well.Are UML Aggregation and Composition Good Concepts?
https://chasethedevil.github.io/post/are-uml-aggregation-and-composition-good-concepts/
Tue, 04 Apr 2006 11:12:00 +0000https://chasethedevil.github.io/post/are-uml-aggregation-and-composition-good-concepts/Yesterday a work collegue made the remark that the notions of aggregation and composition were not very clear. I was a bit surprised at first. But I actually almost always use just associations relations, sometimes composition, I was not sure anymore about the difference between aggregation and association and the one between composition and aggregation. I had to look up in a book to remember what it was all about.SOA and B. Meyer
https://chasethedevil.github.io/post/soa-and-b.-meyer/
Fri, 31 Mar 2006 15:08:00 +0000https://chasethedevil.github.io/post/soa-and-b.-meyer/While rereading parts of Object Oriented Software Construction from B. Meyer, I still find valuable information I overlooked. In the part about functional decomposition where he argues pro and cons of top-down / bottom-up approaches, he has the intuition of the current SOA hype. By showing that
Real systems have no top.
He suggests that the only way to build complex software is through a service oriented architecture. Of course SOA is a very old concept.Tired Of 'My 10 Best XXX' Blog Posts
https://chasethedevil.github.io/post/tired-of-my-10-best-xxx-blog-posts/
Thu, 30 Mar 2006 10:32:00 +0000https://chasethedevil.github.io/post/tired-of-my-10-best-xxx-blog-posts/It's incredible how many posts on popular aggregators are just about a list of stuff, and how except one word they sound the same.
Only today on Javaworld, I can read:
" Ten Things Every Java Developer Should Know About Unix"
"My 10 Favorite Scripting Languages " "7 Must-Have Programs for Windows"
They all seem to have read the "10 best ways to have your post popular on delicious"Bilinear Gaussian Lanczos? Downsampling!
https://chasethedevil.github.io/post/bilinear-gaussian-lanczos-downsampling/
Fri, 17 Mar 2006 17:32:00 +0000https://chasethedevil.github.io/post/bilinear-gaussian-lanczos-downsampling/Not easy to choose a downsampling algorithm. Some links:
mplayer: advises bilinear for quality and describes artifacts for each algo a blogger: advises lanczos. This links shows pictures produced by each algo.
digital image interpolation: seems to have a preference for bicubic, what photoshop uses. videohelp: tested various algorithms and think Bicubic spline is the best.People don't seem to agree. If you want to check the theory: wikipedia lanczosGetting Started With DOM, XOM, DOM4J by Parsing an RSS Feed - An Experience Review
https://chasethedevil.github.io/post/getting-started-with-dom-xom-dom4j-by-parsing-an-rss-feed---an-experience-review/
Fri, 17 Mar 2006 10:53:00 +0000https://chasethedevil.github.io/post/getting-started-with-dom-xom-dom4j-by-parsing-an-rss-feed---an-experience-review/Recently, I looked for a way to get info from some particular blog entries of mine on blogger.com. Blogger used to offer an XML-RPC API . They even designed a version 2 of the XML-RPC API that does not seem to have ever been put in production. Or maybe I did not manage to make it work. I had no problem to make v1 work, however. I used apache XMLRPC v2, it was very simple to use.Bad JDK Design Example
https://chasethedevil.github.io/post/bad-jdk-design-example/
Thu, 16 Mar 2006 15:02:00 +0000https://chasethedevil.github.io/post/bad-jdk-design-example/Have you ever used the Authenticator class? It is standard since JDK 1.2. This allows you to establish authenticated HTTP requests. OnJava has an in-depth article presenting it. Now here is my story about it.The other day I just wanted to do that a simple authenticated HTTP request. You would expect it to be very simple to do in the modern internet world. It is actually not very difficult to do, by hand, a JavaWorld article presents this way.Current Popular Subjects In Java Blogs
https://chasethedevil.github.io/post/current-popular-subjects-in-java-blogs/
Wed, 15 Mar 2006 20:00:00 +0000https://chasethedevil.github.io/post/current-popular-subjects-in-java-blogs/Based on my blogs entries and success of other blog entries, I present the current trendy subjects and the not trendy ones:
In:
Design Patterns Ruby on Rails EJB (bashing) RSS Spring Hibernate Javascript and AJAX Java Virtual Machine Out:
RMI Portal Jini Neutral
JDK 5 features As you can see most of the popular stuff is fairly common, not that new. I will do a finer, less common, analysis later if I have time.Non Fiction Books (Mostly Software Programming) Before 2003
https://chasethedevil.github.io/post/non-fiction-books-mostly-software-programming-before-2003/
Wed, 15 Mar 2006 15:03:00 +0000https://chasethedevil.github.io/post/non-fiction-books-mostly-software-programming-before-2003/A page with useful reference for me as I don't own each one of these books. It can provides you a very short review non-commercial biased.
2003
Programming Jakarta Struts (O'Reilly - Chuck Cavaness) much better than Manning book. Explains struts very clearly with a more interesting example. Not enough on how to design your application for use with the evil ActionForm. Almost nothing on Struts 1.1 features. Nothing on common problems encountered while building web applications, or even about on how to design them using struts.How Mac Os X Made Me Discover a Bug in my Java Prog
https://chasethedevil.github.io/post/how-mac-os-x-made-me-discover-a-bug-in-my-java-prog/
Tue, 14 Mar 2006 20:15:00 +0000https://chasethedevil.github.io/post/how-mac-os-x-made-me-discover-a-bug-in-my-java-prog/Yesterday I had some free time to finally find out why MacOs X would not display my little applet properly. I checked various JDKs for MacOs, no difference. I checked if it was due to antialiasing use, no luck. I actually found out there was an error in the way I displayed images. I did not call repaint() between each image change. Strangely, it worked fine on Windows with many JDKs.Del.icio.us Firefox Toolbar Update
https://chasethedevil.github.io/post/del.icio.us-firefox-toolbar-update/
Mon, 13 Mar 2006 19:45:00 +0000https://chasethedevil.github.io/post/del.icio.us-firefox-toolbar-update/I updated my little delicious toolbar that provides autosave feature for me. I did not bother reworking the new delicious extension as I don't use its new functionalities. However people are free to do so if they want with the code from this toolbar.
With Firefox 1.5, display of saved documents was not working properly anymore due to a change in Firefox handling of security permissions to view local files.Why did Netscape choose Javascript?!?
https://chasethedevil.github.io/post/why-did-netscape-choose-javascript/
Thu, 09 Mar 2006 17:10:00 +0000https://chasethedevil.github.io/post/why-did-netscape-choose-javascript/Last year, I have helped building an AJAX web application, where the web client was composed of only one web page and tons of javascript. The 1 web page for a site approach is similar to Gmail and many full AJAX sites. This approach looks quite elegant. Using JSON (and JSON templates) we were able to separated fully presentation logic and business logic and componentization seemed to occur naturally.
But I remember how often I complained on how bad Javascript was to code.New Mac Mini
https://chasethedevil.github.io/post/new-mac-mini/
Tue, 07 Mar 2006 20:51:00 +0000https://chasethedevil.github.io/post/new-mac-mini/Here is my new Mac Mini Core Solo. I am quite happy with it since it is very quiet. It makes a good jukebox/movie/server machine. Apple was very quick in shipping it (2 days)
However I was a bit disappointed by iPhoto 6, it is not as nice as Picasa to sort out pictures (no IPTC support). I did not try Java on it yet. I just found out my little Benham circle applet was not working properly on it.Features That Ruby Lacks and Java Has
https://chasethedevil.github.io/post/features-that-ruby-lacks-and-java-has/
Fri, 10 Feb 2006 15:57:00 +0000https://chasethedevil.github.io/post/features-that-ruby-lacks-and-java-has/Bertrand Meyer describes in his book " Object Oriented Software Construction (2nd Ed)" qualities that a good object oriented language should have. Java has almost all the features. Ruby is much farther off, which does not mean it is not a good language, I think it's very good to write some types of programs quickly (should I call them scripts?), syntax is quite nice, but it does lack the following useful features: Assertions:The language should make it possible to equip a class and its features with assertions (preconditions, postconditions and invariants), relying on tools to produce documentation out of these assertions and, optionally, monitor them at run time.What Is 'Modern' Java Compilation?
https://chasethedevil.github.io/post/what-is-modern-java-compilation/
Tue, 07 Feb 2006 11:12:00 +0000https://chasethedevil.github.io/post/what-is-modern-java-compilation/Occasionally in Ant you can see messages like this:
"[javac] Using modern compiler" What does this mean? In Ant you have the property " build.compiler" to specify if you want to use a classic or modern compiler. Now what do they mean by modern or classic. Well, they call classic compiler the compilers of JDK 1.1 and 1.2 and they call modern compiler the ones of JDK 1.3+. They made that distinction because a classic compiler does not support the same options as modern compilers: the semantics of javac tool changed in JDK 1.RMI Nightmares - Non Interoperability
https://chasethedevil.github.io/post/rmi-nightmares---non-interoperability/
Tue, 31 Jan 2006 18:39:00 +0000https://chasethedevil.github.io/post/rmi-nightmares---non-interoperability/These days we tried to make Websphere and Jonas interoperate. Some EJBs are deployed in Jonas and we just try to call them from Websphere. The most natural way is to use RMI (with JRMP) for that. Jonas uses JDK1.4.2 (conforms to J2EE 1.4) and Websphere IBM JVM 1.3.1 (conforms to J2EE 1.3). Because of RMI serialization, an EJB from Jonas will not work on Websphere, because this EJB has references to J2EE 1.What Is Clustering About – An answer to Spring is not designed for scalability
https://chasethedevil.github.io/post/what-is-clustering-about--an-answer-to-spring-is-not-designed-for-scalability/
Mon, 16 Jan 2006 16:57:00 +0000https://chasethedevil.github.io/post/what-is-clustering-about--an-answer-to-spring-is-not-designed-for-scalability/I wanted to reply to Diego Parilla post about scalability, but my reply ended up being too long not to post it over here. I don’t know if I am the only one here but I don’t fully understand his post and arguments.
Clustering the web server and clustering the model are just two parts of clustering, not exclusive.
In a LAMP application, clustering the model is traditionally done by clustering the DB (MySQL) which is a no brainer.My Dream Job
https://chasethedevil.github.io/post/my-dream-job/
Thu, 12 Jan 2006 11:42:00 +0000https://chasethedevil.github.io/post/my-dream-job/In my dream job, I would have freedom to play with and build software based on new ideas I have.
In my dream job, I would work with creative people, luminaries.
In my dream job, I would have a good enough salary.
In my dream job, I would not have to worry about the company stability.
In my dream job, I would have freedom in my work schedule.
Get paid for doing what you really want (i.Ogg better than MPC and MP3 - AAC crap
https://chasethedevil.github.io/post/ogg-better-than-mpc-and-mp3---aac-crap/
Wed, 04 Jan 2006 11:47:00 +0000https://chasethedevil.github.io/post/ogg-better-than-mpc-and-mp3---aac-crap/The latest well done (e.g. blind) listening test comparing Ogg, MPC, MP3, AAC at about 180kbps shows that Ogg is superior to all other compressing formats. It’s not that easy to find relevant tests. Many people claim to be able to notice huge differences between CD and MP3 and yet, but confronted to a blind listening test, they are very surprised how difficult it actually is. Hydrogenaudio has a good community of audiophiles.What's Your Favorite Design Pattern
https://chasethedevil.github.io/post/whats-your-favorite-design-pattern/
Tue, 27 Dec 2005 12:18:00 +0000https://chasethedevil.github.io/post/whats-your-favorite-design-pattern/Once in a job interview, someone asked me
What’s your favorite design pattern?
I was first surprised at the question. Usually a design pattern is about solving a problem not about a personal preference. I wondered if it was a trick question of some sorts. I was hesitating with my answer and asked more about the meaning of the question. I just had to really give the pattern I liked the most!Professional Portal Development Book Review
https://chasethedevil.github.io/post/professional-portal-development-book-review/
Tue, 27 Dec 2005 12:08:00 +0000https://chasethedevil.github.io/post/professional-portal-development-book-review/I just finished reading Professional Portal Development With Open Source Tools (Wiley).
The Good:
I enjoyed Chapter 1, it gives a good presentation of Portlets for someone who does not know much about it. It is a chapter one can use as a reference to verify some specific details of how Portlets are working. It is a bit similar to JSR 168 specifications, but I found it more detailed and well written.IBM Websphere Portal Strategy
https://chasethedevil.github.io/post/ibm-websphere-portal-strategy/
Wed, 07 Dec 2005 17:48:00 +0000https://chasethedevil.github.io/post/ibm-websphere-portal-strategy/I digged a bit deeper in a current project where they use IBM Websphere Portal Server (WPS) with IBM Web Content Management (WCM). I found out that both products collide and disintegrate.
WCM is like a regular content management system, quite flexible and performant on its own. It has a nice way to separate layout concern from content concern. It has a flexible cache. It has a user repository to set different permissions.Portlets in an AJAX World
https://chasethedevil.github.io/post/portlets-in-an-ajax-world/
Tue, 29 Nov 2005 16:29:00 +0000https://chasethedevil.github.io/post/portlets-in-an-ajax-world/Recently, I have had my first encounter with Portlets although Portlets are not very new. IBM had their own Portlet API before the JSR 168 was final in 2003. Unfortunately both approaches are quite different and IBM does not recommend the use of their own API.
Portlets were a needed concept for a long time. I worked in 2000 on a java portal system and it would have been handy at that time.Good Software Books
https://chasethedevil.github.io/post/good-software-books/
Thu, 17 Nov 2005 21:24:00 +0000https://chasethedevil.github.io/post/good-software-books/A friend asked me for a list, here is it. I found those books the most interesting ones among those I have read about software in the past year or two:
Artificial Intelligence through Prolog, by Neil C. Rowe (Prentice-Hall): if you don't remember much about Prolog, it's a good book. It details how Prolog interpreters work. File Systems Forensic Analysis, by Brian Carrier (Addison Wesley): everything you need to know about disks and file systems, every trick to recover lost data.Apple Rumors and X86 first move
https://chasethedevil.github.io/post/apple-rumors-and-x86-first-move/
Wed, 16 Nov 2005 17:59:00 +0000https://chasethedevil.github.io/post/apple-rumors-and-x86-first-move/I find the mac mini a particularly compelling computer. It is small, noise friendly, relatively cheap. If you want to have a cheap home server (based on Linux or MacOS X), this is quite a good choice as you probably don’t want to hear all the fans of bigger computers the whole day. It’s also a very good candidate for a media box: you can connect a huge hard drive for mp3s, and watch your DVDs, photos on a nice LCD (and MacOS helps here).7 Years Later: Still EJBs
https://chasethedevil.github.io/post/7-years-later-still-ejbs/
Mon, 07 Nov 2005 16:29:00 +0000https://chasethedevil.github.io/post/7-years-later-still-ejbs/In 1998, a student of my school had a project with Sun about EJBs. This was the beginning of EJBs, they were not public, and there was no J2EE. At that time he found it utterly complicated, and had difficulties to understand why they made it so complicated.
In 2000, I worked for a company who had built in-house most components of a today J2EE application server. For example, they had their own unified messaging system, on the JSP side, they were already using custom tags, etc.Job Hunting: Interview Madness
https://chasethedevil.github.io/post/job-hunting-interview-madness/
Fri, 04 Nov 2005 10:40:00 +0000https://chasethedevil.github.io/post/job-hunting-interview-madness/I have been doing interviews those past weeks. Today I had to present my resume for the N time where N is big. It is very boring. In France, it is common to have 5 interviews for a small company (that says a bit about how people trust each other and makes me envy Germany where the practice is to select very strictly on the resume and be more relax about interviews).Does Eclipse Rot The Brain?
https://chasethedevil.github.io/post/does-eclipse-rot-the-brain/
Thu, 27 Oct 2005 17:42:00 +0000https://chasethedevil.github.io/post/does-eclipse-rot-the-brain/Slashdot presented a really insightful article on Visual Studio by Charles Petzold called Does Visual Studio Rot the Mind. Interestingly it seems that Eclipse does things better than the future Visual Studio.
Autocomplete in Eclipse is really good and does not suffer of the bottom-up problem M. Petzold mentioned, nor from the forced CTRL-Z. There is no Form designer, and in Java it has been the practice to lay out forms programmatically.Orkut Statistics and Blog Evolution
https://chasethedevil.github.io/post/orkut-statistics-and-blog-evolution/
Tue, 18 Oct 2005 13:03:00 +0000https://chasethedevil.github.io/post/orkut-statistics-and-blog-evolution/I was just having a look at orkut again. As in my last look in the past year, there is not much new or interesting. The technical forums are mostly uninteresting and it almost looks like nothing is going on. Take a look at the orkut java forums, in 1 year, very few messages are good.
Compare that to javablogs.com blogs aggregation, every week there are many interesting posts. The blog model is good because it is targeted at people who want to write.Spring Books Roundup Updated
https://chasethedevil.github.io/post/spring-books-roundup-updated/
Mon, 10 Oct 2005 16:27:00 +0000https://chasethedevil.github.io/post/spring-books-roundup-updated/I am completing my Spring Books Roundup with 2 new books:
Pro Spring, by Apress: a lengthy book, with some unnecessary information, but good overall. I did not like the Part 1, there is not much content in it. Fortunately, Part 2 is much better, dependency injection is very well described, almost on par, with the Fowler article of reference. Other Spring areas are well covered, in a similar manner as in Wrox book, except Java Server Faces, absent from the book, and nothing on Swing as well Spring Reference Documentation, from the springframework.Spring Books Roundup
https://chasethedevil.github.io/post/spring-books-roundup/
Mon, 10 Oct 2005 11:15:00 +0000https://chasethedevil.github.io/post/spring-books-roundup/Spring is hip these days, so I decided to learn a bit more about it. I had used Avalon a while ago, I was attracted by its design by component and the way it seemed to lay out a proper infrastructure to build a server application. In the end, I was a bit disappointed, it required a bit too much glue code for my taste and did not provide that much in exchange.Interesting Plug-In Framework - DPML Transit
https://chasethedevil.github.io/post/interesting-plug-in-framework---dpml-transit/
Thu, 29 Sep 2005 15:20:00 +0000https://chasethedevil.github.io/post/interesting-plug-in-framework---dpml-transit/Today, I just found out about DPML Transit, it is a small framework that helps you build plug-ins based software. It seems to work a bit with DPML Magic, their build system based upon Ant. Both are quite interesting, since in big projects, you often end up with a packaging per component (which DPML Magic seems to make very simple) and a versioning of those components. DPML Transit allows then for an efficient way to look up a particular version of one component.Java Puzzlers - Can you figure this out?
https://chasethedevil.github.io/post/java-puzzlers---can-you-figure-this-out/
Wed, 28 Sep 2005 16:04:00 +0000https://chasethedevil.github.io/post/java-puzzlers---can-you-figure-this-out/The book Java Puzzlers is quite good. I don't think anyone can get every puzzle right. This shows again how you can very easily make someone fail interviews if you ask too silly questions. I suppose that if people were asking those questions they would not expect the right answers, but study the candidate reactions.
Here is a sample:
public class DosEquis {
public static void main(String[] args) {Is Prolog Better Suited Than SQL?
https://chasethedevil.github.io/post/is-prolog-better-suited-than-sql/
Mon, 26 Sep 2005 15:36:00 +0000https://chasethedevil.github.io/post/is-prolog-better-suited-than-sql/I am currently reading a Prolog book Artificial Intelligence Through Prolog, I have been doing a bit of Prolog when I was very young and wanted to refresh my memory a bit. It is a very interesting read, especially when I take the viewpoint of our current application where no ACID compliance is required.
It seems to me that all the logic we coded to parametrize SQL queries and construct them dynamically could have been avoided if we had chosen Prolog as Prolog expressions would have been very natural to use in our project.When California Was An Island
https://chasethedevil.github.io/post/when-california-was-an-island/
Wed, 21 Sep 2005 19:01:00 +0000https://chasethedevil.github.io/post/when-california-was-an-island/ This is from an old (1680s) big (2 tons) Coronelli globe, currently displayed in Grand Palais, Paris. Can you spot San Francisco there? Currying - A Very Interesting Use Of Generics
https://chasethedevil.github.io/post/currying---a-very-interesting-use-of-generics/
Fri, 16 Sep 2005 14:41:00 +0000https://chasethedevil.github.io/post/currying---a-very-interesting-use-of-generics/In bamboo-dht, a distributed java hashtable project, the main developer, Sean C. Rhea, advocates the use of Curries and Thunks (of LISP and ML). He wrote an interesting and valuable document, Async Tutorial, presenting a use of it. I will present the concept here shortly:
public interface Thunk1<T> { void run (T t ) ; }
Thunk1<Integer> intThunk = new Thunk1<Integer>() {
void run (Integer i ) { System.out.println( i ) ; }On J2EE Portability Accross Application Servers
https://chasethedevil.github.io/post/on-j2ee-portability-accross-application-servers/
Tue, 13 Sep 2005 16:50:00 +0000https://chasethedevil.github.io/post/on-j2ee-portability-accross-application-servers/Brian Alexander Lee wrote:
“dismal interview where I asked about the candidate’s experience with porting a J2EE application from WebLogic to WebSphere (which was listed on his resume). The candidate said that it was very easy and he just deployed his application with no problems or changes necessary, he had no changes made for the application to run properly. This was one of many bad signs for the candidate.”
I disagree.JavaBlogs Weekly Top 10 and Java HTML parsing
https://chasethedevil.github.io/post/javablogs-weekly-top-10-and-java-html-parsing/
Mon, 12 Sep 2005 16:00:00 +0000https://chasethedevil.github.io/post/javablogs-weekly-top-10-and-java-html-parsing/I took some time to continue my little JavaBlogs analysis, I now have a page summarizing the top 10 most read blog entries in the last week. The page is generated every 24h (this is why there is no ‘best progression’ as of today).
I also fixed some bugs related to HTML in RSS2. I understand a bit better why a RSS 1.0 co-author decided to remove the possibility of HTML descriptions for RSS 3.Spam In Blog Comments
https://chasethedevil.github.io/post/spam-in-blog-comments/
Sat, 10 Sep 2005 01:34:00 +0000https://chasethedevil.github.io/post/spam-in-blog-comments/I was a victim like many other of spams in comments. It’s stupid for people to do that on Blogger.com since the links on comments can not be referenced by search engines (they have some special ‘relative’attribute for that) and improve pagerank.
Fortunately Blogger.com provides a word verification step if you want to avoid random spam. However I am a bit disappointed that they force Blogger.com users to do that word verification as well.JavaBlogs Daily Analysis
https://chasethedevil.github.io/post/javablogs-daily-analysis/
Fri, 09 Sep 2005 17:10:00 +0000https://chasethedevil.github.io/post/javablogs-daily-analysis/I was wondering what blog entries were the most interesting on Javablogs. I decided to write a small application to do that. It was not much more complex to put it online for others to look at as well. It is currently running on http://gopix.net:8081/javabuzz
It also presents Javablogs a bit differently (I like it better that way).
Please note that it is just the result of a 1 (full) day of work currently.Commons-Beanutils Is Slow
https://chasethedevil.github.io/post/commons-beanutils-is-slow/
Wed, 07 Sep 2005 17:28:00 +0000https://chasethedevil.github.io/post/commons-beanutils-is-slow/The BeanUtil.popupate(bean,map) can be very handy, but if you care about performance, it is quite slow. I ran a micro benchmark on my machine (centrino 1.8ghz, JDK1.5) and found out that BeanUtils is up to 40x slower than a hand coded solution (where I assign each bean field manually). I was a bit surprised to find such a difference. I suppose there is a big penalty for using reflection and another big one for the BeanUtils abstraction (automatic casting, etc.Generate your RSS feed in Java
https://chasethedevil.github.io/post/generate-your-rss-feed-in-java/
Mon, 05 Sep 2005 14:03:00 +0000https://chasethedevil.github.io/post/generate-your-rss-feed-in-java/There are some open source projects that can help you in generating or reading RSS feeds in Java. I found only two libraries a bit mature, other code is often embedded in other open source products (jroller for example):
Informa: Does various RSS formats and Atom 0.3. Documentation is better than its alternative, but less focused (has some hibernate helper thingy, some lucene helper, etc.).
Sandler: There is no working homepage while I am writing this.The Evil Port 80
https://chasethedevil.github.io/post/the-evil-port-80/
Thu, 01 Sep 2005 13:46:00 +0000https://chasethedevil.github.io/post/the-evil-port-80/I was writing an Atom feed generator for my current project. I chosed to support Atom 1.0 since it looks like it has the capabilities to establish as the next standard. Unfortunately I quickly saw that it was quite hard to test it in the real world (out of the good feedvalidator), as almost nobody seems to accept Atom 1.0 feeds yet, even if it is rapidely changing (there is support for it in Firefox CVS version).Google Sidebar Hotkey Activation
https://chasethedevil.github.io/post/google-sidebar-hotkey-activation/
Thu, 25 Aug 2005 14:35:00 +0000https://chasethedevil.github.io/post/google-sidebar-hotkey-activation/I like the new Google Desktop with the sidebar. It shares similarities with Konfabulator, recently bought by yahoo. They both allow easy access to some custom little widgets that I would call "active". They are active because they are refreshed periodically with new information (processor usage, news, scratch pad, emails, etc). But while Konfabulator choose to emphasize on visual effects, Google prefers a more standard information presentation. This shows as well in their choice of technologies:I Need Another DB Framework!
https://chasethedevil.github.io/post/i-need-another-db-framework/
Tue, 23 Aug 2005 19:37:00 +0000https://chasethedevil.github.io/post/i-need-another-db-framework/I am currently facing a problem that neither Hibernate nor iBatis solves nicely. I also looked at other ORM or just DB framework, without success.
What I would need is a framework that generates PreparedStatements with a query by Criteria like API. I have many queries that are similar but varying according to different input parameters. iBatis can handle this, but for complex queries and scenarios, the XML becomes completely unreadable, and you therefore loose any advantage that iBatis was bringing with the externalization of SQL statements in XML.del.icio.us toolbar customized
https://chasethedevil.github.io/post/del.icio.us-toolbar-customized/
Sun, 21 Aug 2005 05:20:00 +0000https://chasethedevil.github.io/post/del.icio.us-toolbar-customized/When I bookmark articles with delicious, I like to keep the content on my hard drive, because pages sometimes change, or are removed, or I want to do local searches. I believe this is one reason some people like furl (furl keeps a copy on their server that only yourself can read, but does not allow search).
A combination of slogger and delicious could solve partially the problem. But it is not integrated, I can't get my local version from delicious, so I loose the tagging, listing and all other plus from delicious.Inside the Java Virtual Machine
https://chasethedevil.github.io/post/inside-the-java-virtual-machine/
Thu, 18 Aug 2005 11:03:00 +0000https://chasethedevil.github.io/post/inside-the-java-virtual-machine/I am reading an old book, Inside the Java Virtual Machine. Some old books don't age, and this is one of them. The chapter on the Java Virtual Machine is just excellent and should be read by every Java developer. It explains each step a JVM does when you run a Java program, very clearly.
You could get plenty of stupid interview questions from it like: How is the Java stack used?Firefox Shortcut URL as Command Line for the Web
https://chasethedevil.github.io/post/firefox-shortcut-url-as-command-line-for-the-web/
Tue, 16 Aug 2005 13:42:00 +0000https://chasethedevil.github.io/post/firefox-shortcut-url-as-command-line-for-the-web/I have been doing some work on Firefox extensions. Mozilla/Firefox is a really interesting world, it is extremely flexible, you can make it transform the web the way you want.
Recently, someone started YubNub, the "command line for the web", a very simple idea, but useful. This is a bit similar to the Firefox Search Bar, except more powerful, and quicker to use. Mozilla developers actually had that idea a long time ago (around 2000), it is called shortcut url.Hibernate Criteria API vs HQL Overhead
https://chasethedevil.github.io/post/hibernate-criteria-api-vs-hql-overhead/
Wed, 10 Aug 2005 14:16:00 +0000https://chasethedevil.github.io/post/hibernate-criteria-api-vs-hql-overhead/I was wondering what was the framework weight in the performance of my application, and I wanted to check at several frameworks performance. I used JMeter to benchmark a stripped application (database access through tomcat) under various loads. My very modest test shows no significant difference between Hibernate Criteria API and HQL access for queries. Criteria might be a few milliseconds slower, but my query time will take 10x more time, even for a relatively simple query (my query is has 3 inner joins, is grouped, with a count and takes only 4ms when performed once in mysql under no load).How to become a JavaRSS member on blogger.com
https://chasethedevil.github.io/post/how-to-become-a-javarss-member-on-blogger.com/
Fri, 05 Aug 2005 13:32:00 +0000https://chasethedevil.github.io/post/how-to-become-a-javarss-member-on-blogger.com/The trick is to create a post with the javarss image and to use the link generated by blogger.com to display the image. Then you can follow the rules from http://www.javarss.com/pages/?page=suggestJava is more productive than Ruby/Rails
https://chasethedevil.github.io/post/java-is-more-productive-than-rubyrails/
Tue, 26 Jul 2005 13:26:00 +0000https://chasethedevil.github.io/post/java-is-more-productive-than-rubyrails/I have been doing some Ruby On Rails, for 2 small projects. While I think it is good, I think it is overhyped as well. It is well designed, has good ideas (easy configuration), and focus on the right problem, architecture. But my conclusion is that I am not more productive with it than with Java.
I think most of the development time is not spent coding, but thinking. It is a very obvious statement, and yet too often ignored.féminisme et statistiques
https://chasethedevil.github.io/post/f%C3%A9minisme-et-statistiques/
Thu, 21 Jul 2005 12:16:00 +0000https://chasethedevil.github.io/post/f%C3%A9minisme-et-statistiques/Sur ce lien, un article un peu trop long, mais avec pas mal de points intéressants:
6 femmes par mois décèdent, en France, par violence conjugale, soit plus que le nombre de victimes du metro anglais sur un an. Pour toutes les statistiques sur les chances de mourir suivant les causes, aux Etats-Unis, cliquer ici (on voit notamment que le plus grand risque est l'accident de voiture, ou la chute, ou le suicide par arme à feu, devant les attaques par arme à feu).Ruby, Python, JavaScript, Lua, Java, C++ benchmark
https://chasethedevil.github.io/post/ruby-python-javascript-lua-java-c-benchmark/
Wed, 20 Jul 2005 11:49:00 +0000https://chasethedevil.github.io/post/ruby-python-javascript-lua-java-c-benchmark/Simple benchmark but with interesting comments here:
Some of the conclusions are:
Java interpreter is very good Java JIT is as fast as C++ Ruby, JavaScript, Python are of similar order of magnitude speed, Ruby the slowest. It would have been interesting to benchmark interpreted languages for the JVM.
Now for most projects, architecture, not language is key in achieving good performance.Fowler On Your Future: editing the abstract representation of a program
https://chasethedevil.github.io/post/fowler-on-your-future-editing-the-abstract-representation-of-a-program/
Tue, 19 Jul 2005 12:40:00 +0000https://chasethedevil.github.io/post/fowler-on-your-future-editing-the-abstract-representation-of-a-program/This Fowler article on "language workbench" reminds me of Gosling Jackpot ideas: it is about a different interaction with your program where the source code does not matter so much, but its structure. It must be fascinating to work on this kind of project.
Maybe MDA sounds similar to you, after all, actual language workbench systems are generating source code. But the fundamental difference is that a workbench generated program is much richer and can capture everything you want to do (MDA is too based on UML to be that powerful), also, the source could disappear and be replaced by byte codes only.Jython instead of Ant: sample code
https://chasethedevil.github.io/post/jython-instead-of-ant-sample-code/
Sat, 16 Jul 2005 01:50:00 +0000https://chasethedevil.github.io/post/jython-instead-of-ant-sample-code/Here is an example of how to use jython to deploy a web application under tomcat. The application is supposed here to be WAR packaged in a 'web' directory. Libraries used for the web-app are already in web/WEB-INF/lib, classes are compiled automatically by Eclipse under web/WEB-INF/classes, and resources are copied automatically by Eclipse. If necessary, it is very easy to script those actions in the python script, with very little code.Java development without Ant
https://chasethedevil.github.io/post/java-development-without-ant/
Tue, 12 Jul 2005 16:16:00 +0000https://chasethedevil.github.io/post/java-development-without-ant/When Ant came out, I welcomed it. It was better than Makefiles for Java, it solved the path and classpath format difference between Windows and Linux, did not rely on shell programs. It did provide a platform independent way for building Java software. At that time, there was another alternative, JMK which had a lisp like syntax, and solved the same problems as Ant. But Ant was backed by apache, and this were the times of XML everywhere.lion
https://chasethedevil.github.io/post/lion/
Tue, 28 Jun 2005 17:00:00 +0000https://chasethedevil.github.io/post/lion/ test This is who I am
https://chasethedevil.github.io/post/this-is-who-i-am/
Sun, 19 Jun 2005 18:20:00 +0000https://chasethedevil.github.io/post/this-is-who-i-am/