Category Archives: General

Why you should not use JustCloud for your backups!

Today I wanted to share with you my experience using the services of JustCloud to backup my personal file.

I started looking for a cloud backup solution about 2 years ago, since I had accumulated a considerable amount of personal data I did not want to lose and as I knew that personal backups such as external disks and USB keys are not safe enough (they can get damaged easily, they can get stolen or lost etc…).

I looked at a few different online comparisons  and found out that JustCloud was the best rated one, so I decided I would give it a go.

Their services looks relatively cheap at first sight, but you will very limited with the basic package and very quickly harassed to buy extra options. Sadly, the service focuses on how many devices you use as opposed to how much data you’re using, so it becomes quite expensive when you have multiple computers, which is my case.

All this worked fine for the 2 years I’ve been using their product and lately I received an e-mail saying I had to renew my subscription. I then decided I would try to retrieve some of the data I had previously stored in order to see if it was really worth it compared to a simple Google Drive solution.

I tried both via the UI and via the FTP method, none worked on my first laptop. It was impossible to connect to the FTP and their software was stopping the recovery procedure a few seconds after it started.

I got in touch with their support team via the online chat. As expected, they were completely useless and essentially only asked very basic questions trying to understand my problem… which was “I cannot retrieve my files at all, I want them all back”. After a couple of minutes, the guy told me they were “aware of the issue I was facing” but he needed to escalate my request to the development team who would get back to me about 4 days later.

First, this is completely unacceptable. If you pay for a backup solution the whole point is to have your backup available on demand, not to have to wait days until somebody helps you out. In particular, they should be going absolutely crazy knowing a client cannot recover his files as the is the key of their services; this is in fact the only thing I am paying for!

Needless to say they never got back to me and yesterday suspended my account because I had not renewed. I did get in touch with their subscription department telling them that a technical issue was ongoing on their side and that they should not suspend the account, but never got a proper answer. There is probably nobody behind this department as most answers I got were automatic reminders, signed by a person I could not find on LinkedIn, for example.

The funniest thing is that today I got an e-mail from the same fake sales person, saying that now that my account was suspended, they were offering me a discount to renew, without of course mentioning anything about my issue not being solved.

I did manage to recover part of the files using another computer. But since I had not lost the originals, I compared and there were several files missing! Clearly this service cannot be trusted.

I would strongly encourage you not to trust JustCloud and to advise anybody using their service to recover their data as soon as possible and seek for a new solution.

I have not considered asking for a refund of the past 2 years of services, although I sincerely feel the service I paid for was not provided as my data could not be recovered. If you have experienced the same and wish to push for a refund, get in touch with me and we might be able to get something back if there are more of us.

I have found multiple articles such as this one where other users share the same experience.

The early days of Quantitative Finance

A lot of people start studying Quantitative Finance because they see it as a great way to earn money. It seems indeed reasonable that somebody with great mathematical skills would be looking for opportunities allowing him to make a profit — sometimes at the expense of others. I can still remember like yesterday seeing a friend — clearly one of the smartest persons I’ve met — losing money at a roulette table being certain that he had a winning strategy (!) as well as countless classmates claiming they could easily make a profit out of the stock market.

Nowadays, we have books about it, computers to help us and  well-known strategies which make it always more difficult to make long-term risk-adjusted profits because all available opportunities are quickly taken away by sophisticated investors.

But how did it work in the old days? Who were the first people to study the field? When did it start? How did they put it in place? Did they make a fortune? Are they still making a fortune? All these questions are fascinating to me, and I just finished reading up a book called Fortune’s Formula by William Poundstone which addresses these topics.

Obviously, this book does not contain any fortune formulas, but it depicts the stories of the men who contributed to the field in the early days. This book was fascinating because it talks about some very important “discoveries” such as the Kelly criterion, based on Information Theory, Modern Portfolio Theory, Market Efficiency and how these techniques were put to practice at the very beginning. It also talks about how the first formula to price warrants was discovered and the struggles through which Edward Thorp went before he could really make money out of it — and how it all ended. We also learn how some brilliant minds — Noble Prize winners — got caught and lost everything in the LTCM collapse.

The good thing about this book, is that it explains all this in relatively simple words. Indeed, Poundstone focuses on the concepts rather than on the technicalities and puts everything in historical context such that any interested reader can go through the pages without being lost in details.

If you’re planning to go on holidays at the end of the year and you’re looking for a good book to read, I strongly recommend this one.

Expected Shortfall closed-form for Normal distribution

Today, I would like to share a little exercise I did to compute the Expected Shortfall of a normal variable. For those of you who are not familiar with this risk measure, it evaluates the average of the $(1-\alpha)$-worst outcomes of a probability distribution (example and formal definition follow).

If you have enough data, the expected shortfall can be empirically estimated. Let’s say we want to compute the expected shortfall at 95% (denoted $ES_\text{95%}$) and that we have 1000 points. The first thing to do is to sort the 1000 points. Then, we take the $1-95\%=5\%$ worst outcomes, which is for 1000 points $1000 \cdot 5\% = 50$ points. Finally, we simply average these points to get our estimated expected shortfall. Nevertheless, this is only an estimate and it will be precise only if you have enough points available.

Sometimes, you can assume the distribution of the points and when these points are a set of returns, it is quite common to assume that they follow some normal distribution $\mathcal{N}(\mu,\sigma^2)$. In this case, you can find a closed form formula which gives you the exact solution for a given $\alpha$, given the parameters $\mu$ and $\sigma$. This result is available in several papers but usually comes without the proof, which I will provide below.

Let’s assume we have a random variable $X \sim \mathcal{N}(\mu,\sigma^2)$. The first thing to do is to re-express this variable in term of a standard normal variable $Z \sim \mathcal{N}(0,1)$. This is easily done as follows:

$$ X = \mu + \sigma Z $$

The next thing to do is to express the Value at Risk at a certain level $\alpha$, which is defined as follows:

$$\text{VaR}_\alpha (X) = \{ Y ~ | ~ \mathbb{P}(X \leq Y) = 1-\alpha \}$$

This can be easily found as well, since:
$$
\begin{align}
\mathbb{P}(X \leq Y) &= \mathbb{P}( \mu + \sigma Z \leq Y)\\
&= \mathbb{P} \left(Z \leq \frac{Y-\mu}{\sigma} \right)\\
&= \Phi \left( \frac{Y-\mu}{\sigma} \right) = 1-\alpha\\
\end{align}
$$
where $\Phi(\cdot)$ is the cumulative standard normal distribution.

We can then deduce that:
$$\text{VaR}_\alpha (X) = Y = \Phi^{-1}(1-\alpha) \sigma + \mu$$
where $\Phi^{-1}(\cdot)$ is the inverse cumulative standard normal distribution and which can be looked up online.

Now, we can actually start working on the closed-form. Let’s first express the expected shortfall in terms of the value at risk:
$$ES_\alpha(X) = \frac{1}{1-\alpha} \int_\alpha^1 \text{VaR}_u(X) du$$

Using our previous result, we can rewrite the definition above as follows:
$$
\begin{align}
ES_\alpha(X) &= \frac{1}{1-\alpha} \int_\alpha^1 ( \Phi^{-1}(1-u) \sigma + \mu ) du\\
&= \frac{1}{1-\alpha} \left( \int_\alpha^1 \Phi^{-1}(1-u) \sigma du + \int_\alpha^1 \mu du \right)\\
&= \frac{1}{1-\alpha} \int_\alpha^1 \Phi^{-1}(1-u) \sigma du + \mu
\end{align}
$$

As you can see, we managed to split the big integral into two parts, one of which is solved very easily. However, there remains an integral with $\Phi^{-1}(\cdot)$ which is a very complex function so we need to find a way around. To do this, we are going to use a change of variable introducing $u = \Phi(y)$. We have then $y = \Phi^{-1}(u)$ and $du = \phi(y)dy$ where $\phi(y)=\frac{1}{\sqrt{2\pi}} \exp \left( – \frac{y^2}{2} \right)$ is the standard normal density function.

$$
\begin{align}
\int_\alpha^1 \Phi^{-1}(1-u) \sigma du &= \int_{\Phi^{-1} (\alpha)}^{\Phi^{-1}(1)} \Phi^{-1}\left(\underbrace{ 1-\Phi(y)}_{\Phi(-y)} \right) \sigma \phi (y) dy \\
&= \int_{\Phi^{-1} (\alpha)}^\infty -y \sigma \phi (y) dy \\
&= \int_{\Phi^{-1} (\alpha)}^\infty -\frac{y \sigma}{\sqrt{2\pi}} \exp \left( – \frac{y^2}{2} \right) dy \\
\end{align}
$$

So, we got rid of $\Phi^{-1}(\cdot)$ and the remaining integral is relatively easy to solve:

$$
\begin{align}
\int_{\Phi^{-1} (\alpha)}^\infty -\frac{y \sigma}{\sqrt{2\pi}} \exp \left( – \frac{y^2}{2} \right) dy &= \frac{\sigma}{\sqrt{2\pi}} \int_{\Phi^{-1} (\alpha)}^\infty -y \exp \left( – \frac{y^2}{2} \right) dy\\
&= \frac{\sigma}{\sqrt{2\pi}} \left( \exp \left( – \frac{y^2}{2} \right)\right)|_{\Phi^{-1} (\alpha)}^\infty\\
&= \frac{\sigma}{\sqrt{2\pi}} \left( 0 – \exp \left( – \frac{\Phi^{-1} (\alpha)^2}{2} \right)\right)\\
&= -\sigma \frac{1}{\sqrt{2\pi}} \exp \left( – \frac{\Phi^{-1} (\alpha)^2}{2} \right)\\
&= -\sigma \phi \left( \Phi^{-1} (\alpha) \right)\\
\end{align}
$$

Now, we just have to include this in our previous result to get:

$$
\begin{align}
ES_\alpha(X) &= \frac{1}{1-\alpha} \int_\alpha^1 \Phi^{-1}(1-u) \sigma du + \mu\\
&= \frac{1}{1-\alpha} \left[ -\sigma \phi \left( \Phi^{-1} (\alpha) \right) \right] + \mu\\
&= \mu – \sigma \cdot \frac{\phi \left( \Phi^{-1} (\alpha) \right)}{1-\alpha}
\end{align}
$$

This is a very good result, since we know that $\lambda( \alpha ) = \frac{\phi \left( \Phi^{-1} (\alpha) \right)}{1-\alpha}$ is a function of $\alpha$ that can be computed very easily, for example in Excel. Below are the results for $\alpha$ from 80% to 99%.

lambdas
Values of $\lambda$ for different $\alpha$

That’s it, with this simple formula, you can compute the expected shortfall of a normally distributed variable without needing any data point.

New challenges in Hong Kong!

Hello everyone,

Since arriving in Hong Kong two years ago, I haven’t had too many chances to contribute to this blog. There are multiple reasons to this.

pump-jack-848300_640First of all, my work at Noble Group was taking me a considerable amount of time and energy. It was my first experience in the physical commodity market, and it took me some time to get up to speed and to understand how business works in that field. On top of that, I was lucky to be able to work alongside some amazingly talented individuals. Whilst this gave me an incredible opportunity to learn a lot of new things on topics  I had never worked on before, it was also difficult to live up to expectations. Besides, I also experienced what it meant to work in the headquarters of a global company which has offices literally all around the world. This allowed me to meet a lot of different people and business cultures,  but it also means having to adapt to the time difference with the various offices and essentially having to make calls late at night or early in the morning as well as potentially receiving urgent requests by email or phone in the middle of the night.

Next Friday, I will be leaving Noble Group and moving back to asset management for a Swiss private bank in Hong Kong. I am really looking forward to this new challenge and can’t wait to get started in my new role in November. More on this probably in a later post.

Swisscham YPsIn parallel, I started in 2016 to be actively working with the Swiss Chamber of Commerce. Essentially, the Chamber is a platform for Swiss businesses in Hong Kong. It allows local and Swiss companies or professionals to connect and interact during the events organized by the chamber. In June 2016, I became the President of the Young Professionals Executive Committee. We are organizing monthly events for the Chamber and we help the board of directors in different projects. I invite you to follow our Facebook page for more information about us and to get the most recent updates on our upcoming events.

I will try to add more content from now on if time allows!

Monte-Carlo Method on Panini stickers distribution

Good afternoon everyone,

Today I want to write a funny post which combines two of the most important topics of June 2014: the CFA Level III curriculum and the FIFA World Cup. I know, that a long shot.

I assume that pretty much every reader of this blog had the opportunity to collect Panini stickers before major sporting events. The idea is quite simple. You have an album which you need to fill with stickers that you buy by packs. For the 2014 FIFA World Cup in Brazil, each pack contains 5 stickers and the album has roughly 650 stickers.

When I was a child, I used to buy or to be offered I pack every day and filling the album took weeks. Today, I start off by buying a whole box of 100 packs, which makes it 500 stickers at a time. The thing is, as you open the packs, you would expect to have duplicate stickers that you will exchange with friends for stickers that you don’t already own. This year though, several of my friends and myself bought boxes and got absolutely no duplicate, which mean that we all had an album filled with 500 stickers straightaway.  It then looked clear to me that Panini did this on purpose, but I wanted to make sure using probability thoery.

Question

What is the probability that, after 500 stickers, I still have no duplicate sticker?

Alternatively, you could ask: did Panini make sure that you have no duplicate if you buy a whole box of 500 stickers?

Basic Assumption

For this experiment, I assume that getting the event of getting any sticker is equiprobable. This maximizes the chance of having no duplicate after several draws. Formally, I define a random variable $X$ which can take any value between 1 and $m$ (the number of existing stickers) and which represents the event of drawing the sticker’s number. Then we have that the probability of drawing sticker number $i$ is:

$$\mathbb{P}(X=i)=\frac{1}{m}$$

In our case, $m=650$ and the probability of getting any sticker is roughly 0.15%.

Single draws

To begin, I remove the concept of packs and assume that I get every sticker randomly with the probability mentioned above. In this setup, it is quite easy to compute the probability of having no duplicate after $n$ draws:

After 1 draw, the probability of having a duplicate is 100%; of course, because you have no stickers at all.

After 2 draws, the probability of having no duplicate is:

$$\frac{650-1}{650}=\frac{649}{650}=99.85\%$$

The idea is simple: on the numerator is the number of cards that we don’t already have and on the denominator is the number of possible cards. When then multiply this probability by the probability of having no duplicate so far (which was 100%, i.e. 1, in this case).

After 3 draws we have:

$$99.85 \% \cdot \frac{650-2}{650}=99.54\%$$

We can generalize this by saying that for $m$ existing different stickers, the probability of having no duplicate after $n$ draws is:

$$\prod_{i=1}^n \frac{m – (i-1)}{m}$$

That’s rather easy to compute using any programming language such as Matlab or C#.

Coming back to our world cup 2014 example, we can draw the following chart to see how the probability of having no duplicate evolves along with the number of single draws performed:

Probability of having no duplicate after n draws
Probability of having no duplicate after n draws

As you can see, in this setup the probability of having no duplicate is almost 0% after 100 draws. So, there is little chance that this occurred if Panini did not make something special about it.

Draws from packs

On argument that could be made is that you should not have any duplicate within a single pack. In this case, you are sure to have 5 distinct cards  every time you open a pack, and it should slightly boost your probability to have no duplicates after $n$ draws. This can be shown using a simple example: assume you draw 5 single cards, the probability of having no duplicate using the formula above gives 98.47%. If you get cards by pack, drawing 5 cards corresponds to drawing 1 pack, which by assumption guarantees having no duplicates (probability of 100%).

So, how do we compute the probability of having no duplicate after opening $n$ packs? Well I guess it is possible to formulate it mathematically, and frankly when I thought about this I was not really in the mood of digging into all these permutations. So, I decided to go with another approach: a monte-carlo simulation. How does that work? The idea is quite simple: I am going to create a computer program that simulates the process of opening packs of stickers. Here is how the program will work:

Creating a pack

I assume the pack contains $p$ stickers, with an equal probability of drawing any sticker.

  • Start with an empty pack
  • As long as I don’t have $p$ stickers in the pack
    • Draw a sticker randomly
    • If the sticker is not already in the pack
      • Add the sticker to the pack
  • Return the full pack

Running a simulation

Now that I have a procedure to create a pack, I will define what I mean by running a simulation. The idea is to simulate the action of opening packs randomly generated on the fly until I get a duplicate in the stickers I got:

  • Start with an empty album
  • Until I have a duplicate a duplicate sticker
    • Generate a random pack
    • Open the pack and put the stickers in the album
  • Return the number of opened packs

So, what I’m doing here is to simulate a random variable $Y$ which is the number of opened pack before getting a duplicate.

Back to our Panini example, we really simulate opening packs as we do from the box of 100 packs. What we would like to do is to estimate the probability distribution of this variable $Y$ in order to be able to discuss whether it is statistically possible that we got no duplicate after 100 packs. This is where Monte-Carlo simulation comes into action.

Monte-Carlo simulation

The principle of Monte-Carlo simulation is to simulate the outcome of a random variable $k$ times, where $k$ is very large. We divide the number of each outcome we got  by the total number of simulations, $k$. This gives us an estimation of the probability of each outcome.

This is exactly what I did for the Panini example, and I got the following results:

Probability of having first duplicate after opening n packs.
Probability of having first duplicate after opening n packs.

In the graph above, you see the probability of having the first duplicate after opening $n$ packs, i.e. $\mathbb{P}(Y=n)$. To be able to make a final assessment, we would like to see the estimated cumulative distribution of $Y$ which corresponds to the probability of having at list a duplicate after opening $n$ packs:

Cumulative Probability of having at least one duplicate after opening n pack.
Cumulative Probability of having at least one duplicate after opening n pack.

As you can see, after 15 packs, there is a probability of having no duplicate of almost zero. That is, a probability of about 0 of having no duplicate after $5 \cdot 15 = 75$ stickers. This means that there is almost no chance that my friends and I had no duplicate after opening a whole box of 100 packs.

So, there is not much difference with the simple model, but that’s not really the point. The idea is that it was hard to get a closed form of the probability of having at least duplicate after $n$ packs, but that by using the Monte-Carlo simulation, we managed to estimate this. This is sometimes also used for simulating scenarios under some model assumptions!

I hope you enjoyed this funny example!

Cheers,

Jeremie