Friday, May 30, 2014

Source code for the data cost simulator

Over Golden Week, on several long flights with AC power, I got bored and wrote a script for determining which data plan is most likely to cost the least over time. Now, I've released the source code as a MATLAB function (that also works in GNU Octave – with some caveats). It uses data consumption information you supply to consider the probability of future usage, then calculates the corresponding total cost based on different plans and overage costs.

You can find it here on github.


It is most useful when there are multiple people or devices sharing a single data plan. For example consider a family of four or five people who on average use a combined 17 GB of data each month. From NTT Docomo, 15 GB of data costs ¥12,500 per month, 20 GB costs ¥16,000, and each additional 1 GB costs an extra ¥1,000. If the total usage was exactly 17 GB each month, then the 15 GB plan would cost less:

¥12,500 + ¥2,000 =¥14,500/month for 17 GB versus ¥16,000 for the 20 GB plan. That would save ¥36,000 over a 2-year contract.

However, if total usage is highly variable from month to month, the decision on which is best becomes more complicated. The purpose of this function is to give you a better idea of how variable usage can affect the total cost.

Meaning of the results

In many cases, like I demonstrated at the bottom of this post, there may be no significant difference between all the options. In the linked case, which is based on my actual usage, I'm only looking at a difference of about ¥80 each month between the most expensive and least expensive options.

Even though there was no clear "winner", this is still useful information. I don't have to worry that I've made some drastic mistake that's going to cost a whole lot of extra money, and I am free to decide based on other, less tangible considerations. I could decide that I don't want to worry about having to frequently add additional GBs to my account and just decide to go with the larger quota. Or, I could decide (and this is what I actually did) that the option including a completely contract free, prepaid b-mobile FAIR SIM was best, even though there is a high chance that it would cost slightly more over two years. (And by slightly more I mean slightly.)

What it does

This is a MATLAB function that uses Monte Carlo methods to determine the most probable outcome and the uncertainty around that outcome. By default, it assumes all usage data are normally distributed (a "bell curve"), but it also allows you to specify different distributions that skew the probability towards either high or low usage. You can also specify that usage is "bimodal", meaning that there's a high probability of using very little data, and a high probability of using a lot of data, but very little chance of something in the middle. (This case would occur when someone often spends the better part of a billing cycle outside of Japan.)

The function then fits a probability density function to your data using the specified distribution and randomly draws monthly total data consumption values for the period of time specified (default is 24 months, the typical mobile contract length). This is repeated one thousand times to converge on the most probably outcome with an idea of the degree to which extreme cases are likely to occur. It next calculates the cost based on supplied quota, overage, and additional SIM card pricing. There is a built-in assumption (that can be changed) that if the quota would be exceeded with only four days remaining in the billing cycle, that no additional data are purchased and everyone suffers through at 128 kbps.

The defaults are for NTT Docomo and depend on the number of devices/people being considered: 2 devices assumes a phone and data-only tablet; 3 or more assumes all phones. Required, optional and default inputs, as well as GNU Octave compatibility, are described on the wiki page.


This is "example 1" included with the function. It considers a family of four people sharing a single data plan. The first person (mother) uses a moderate amount of data but tends toward lower amounts with the occasionally high-usage month. The next person (son who downloads who knows what over mobile) uses massive amounts of data, often in the double digits, and the usage is fairly regular each month (normal). The third person (daughter) is the opposite of the first, typically using a lot of data but on occasion uses very little. The final person (father) has months where they hardly use any data (overseas business), and months were he uses a lot, with little in between.

Past data usage for each member of the family of four.

Considering the combined average usage yields a mean of 17.4 GB per month, with a reasonable potential of having usage as low as 11.3 GB and as high as 23.4 GB (1 standard deviation range). 17.4 GB would cost ¥15,500 with the 15 GB Docomo plan. The 20 GB plan would cost ¥500 more. (The median usage is actually just under 17 GB and would yield a ¥1,500 monthly savings.)

You can probably guess that the 10 GB plan won't do, and you would think about either the 15 GB or the 20 GB plan. The 15 GB plan at first seems like it could save a lot of money over time based on the average usage, but how many months will that extreme value of 23 GB occur? Let's run the simulation to get an idea.
Cumulative cost with 1-standard deviation range shown for each data plan (10, 15, 20, and 30 GB).

And we see that the 15 GB plan may not be the best after all. The interplay between all the different usage patterns causes high consumption enough times over the next two years to make the 20 GB plan clearly less expensive (though not by a huge amount). In this particular result, the 20 GB plan was least expensive in 99.6% of the simulations. Based on this, and keeping in mind this is only as good as the assumption that past usage will reflect future usage, I would be virtually certain that this family would spend the least amount of money on the larger 20 GB plan.

Thursday, May 29, 2014

NTT Docomo to offer iPad. Who cares?

I'll steal a phrase from Adamu to describe this.

NTT Docomo will begin taking preorders for the iPad Air and iPad Mini Retina on June 2nd, and the devices will go on sale June 10th.

With the new pricing structure of Docomo data-only plans, where 5GB now costs ¥7,000 when 7GB used to cost ¥6,000, there is really no reason at all to buy a tablet from Docomo unless you are bundling with a number of devices.

Even so, the minimum cost of adding each additional device is ¥2,400 (slightly more if you don't hack the device and want to tether.)

You are much better off picking up a fully unlocked iPad and trying your luck overcoming Apple's locked down APN settings to get an LTE connection with an MVNO.

Docomo's iPad page.

Don't leave MVNOs for new docomo shared data plans

More than ever, if you are looking for mobile data access for a single device that won't be used as a phone, then MVNOs in Japan are your best bet.

I realize that I greatly misinterpreted the cost of docomo's new data plan for data-only devices. I think the original materials I read didn't include mention of the "base fee" for data-only devices. (At least that's my story and I'm sticking to it. ;))

You see, there is already the ISP charge of at least ¥200, then there is the share charge of ¥500. What else can there possibly be? Where is there room left to manufacture additional charges? Unnecessary ISP charge? Check! Charge for adding an additional line? Check!

Turns out there is also the "data plan" at ¥1,700, which is to put it bluntly pretty much bullshit.

What do you get for the ¥1,700 data plan? Nothing. There is no included data allowance. It is simply the NEW base fee to enable a data connection on a tablet. If you don't add a data package, you are billed at ¥0.6 per kilobyte. The worst part is that, as far as I can tell, this "data plan" charge didn't exist before, which is part of the reason I overlooked it.

Here are the minimum costs of the new standalone data plans:
  1. ¥1,700 for the data plan that includes no data.
  2. ¥200 for Mopera ISP (Warning, you can't tether with a Docomo OS installed)
  3. ¥3,500 for 2GB of data.
That totals ¥5,400 for just 2GB. What a horrible deal, especially when the current plan gets your 7GB for ¥6,000 including ISP charge. Conversely, the new standalone 5GB data-only plan costs ¥6,900! Why would anyone buy this?

The cost of the existing 7 GB Xi data plan for a tablet is ¥6,000.

Recalculating the potential cost of a phone and tablet

Perhaps you recall that I was considering the probability that any particular data plan would result in the lowest total cost over two years for a combined smartphone and tablet. Keep in mind that I am using the premium bmobile FAIR SIM, which has no additional speed or latency restriction, so I am paying about ¥8,000 for 1 GB of data, but since the tablet almost never consumes over 250 MB per month, this works out be a decent arrangement. The data connection is fast and responsive, unlike many of the other MVNO SIMs, and the monthly cost is about ¥2,000.

Probability Density Functions (PDFs) describing the likely future usage of my two devices.
Previously, when I used the incorrect data plan cost, the shared docomo plan was clearly cheaper. That is no longer the case. The new results are:
  • 2GB plan costs less in 53% of simulations (¥182,366 ± 5887) over a 24 month period
  • 5GB plan costs less in 38% of simulations (¥182,384 ± 1387) over a 24 month period
  • 7GB + FAIR plan costs less in 9% of simulations (¥184,518 ± 0) over a 24 month period
Here is the corresponding result in graphic from. There is no variance in the predicted cost of the FAIR SIM because in no simulations is 1GB exceeded in a four month period.

This includes the cost of an additional Docomo SIM card for the tablet at about ¥3,000. Considering that, there is basically no difference in outcome. I'd probably save less than ¥100 per month by getting the extra docomo SIM AND I'd now be subject to a 2-year, autorenewing contract with a ¥10,000 early termination fee. The FAIR is totally prepaid.

So, unless data usage on the tablet dramatically increases, the shared docomo data plan is essentially worthless to me.

Wednesday, May 14, 2014

NTT Docomo Voice over LTE (VoLTE) service will start in June

NTT Docomo announced today that VoLTE is planned to start in late June. Currently, even for LTE phones, voice is transmitted over the old W-CDMA (3G) network. I'm most interested in how VoLTE from NTT Docomo will affect voice pricing for MVNOs. I believe there is expectations that this will lower wholesale costs.

With VoLTE, audio quality should be improved, due to higher bandwidth (50Hz – 7kHz), which should allow for the use of a better codec. Compared to existing LTE phones, calls should connect faster (since there is no switching to 3G). VoLTE phones can also receive area mail alerts (like the earthquake warnings) while a call is connected. With all the free chat options now available, I doubt it matters any more, but the video calling with also have improved quality over the existing FOMA terebi denwa.

The price plan will include the "kake-houdai" Unlimited Calling announced recently, which is ¥2,700. At launch, four phones will be supported (through software updates). These are:

  • GALAXY S5 SC-04F
  • Xperiz Z2 SO-03F

Sometime after July, updates will come to two tablets (AQUOS PAD SH-06F and the Xperia Z2 Tablet) that will enable VoLTE.

Now that the summer line up has been announced, I would recommend that you don't immediately look for a way to flash a custom OS onto your new phone, as you won't be able to receive the update to enable VoLTE.

Tuesday, May 6, 2014

The cost of sharing a docomo data plan between a phone and a tablet

UPDATE: I misunderstood the cost of the docomo data-only plans. I neglected to account for the ¥1,700 "data plan" price, which is a newly added base fee onto data-only devices. This over doubles the cost of data for a tablet and drastically changes the outcome of the below simulation. See here for a revised estimate.

In the previous post, I described the effect of variable monthly usage on the total, longterm cost of a data plan. To keep things simple, I considered only one person (me) using one device (my phone). The outcome was that both the 5 GB and 2 GB plans (coming soon from Docomo) would be less expensive for me than just continuing to use my current 7 GB plan. There was a good chance that the 2 GB would offer the most savings, but only by a very modest amount of a few thousand yen over 2 years if I don’t modify my future behavior to minimize the number of times I would exceeding the 2 GB quota.

This result is really not surprising and could be obtained without all the extra work of a Monte Carlo simulation, but it was a good way to introduce the framework. Now, I’ll expand it to consider more sources of variance (i.e., more devices). For now I’ll continue to keep it simple and consider just two devices, so the result will again be a bit obvious. (For the next post on this topic, I’ll consider multiple people sharing a large family data plan, the results of which will be much more difficult to predict without simulation.)

Current data plans

Like the previous example, this post will also consider my real usage. I currently have two active SIM cards, one voice+data and one data-only:
The FAIR data plan is the most expensive offered by b-mobile, but it is the only one that has the same average speed and latency as a standard docomo plan. The 1 GB is good for 4 months, so it is ideally suited for devices that consume only 250 MB per month. Of course there are much cheaper ways to get this small amount of monthly data, but speed and responsiveness are hugely sacrificed. (See here for a series of posts on the b-mobile FAIR SIM)
  1. 7 GB Docomo Xi Flat rate (¥5,700/month)
  2. 1 GB b-mobile FAIR (¥7,953/4 months)
Both the 2 GB and 5 GB plans are for individuals but will allow sharing of data between and phone and a data-only device, so I could potentially cancel my current b-mobile plan and get a second docomo SIM for my data-only device. (Swapping out the FAIR SIM for a less expensive but much slower sub-1,000 yen SIM card is not an option for this particular application and would cause me massive headaches if I did, so I find it worth the premium price.)

The above probability density functions (PDFs) show how I expect my phone (right) and tablet (left) to consume data in the future. The b-mobile FAIR SIM uses around 250 MB per month, often a bit less, so you can probably already imagine, based on the result outlined in my previous post, that canceling it would save money.

Data plan options

To keep the high speed and low latency of the FAIR SIM, I have three options:
  1. 7 GB Xi and b-mobile FAIR: ¥5,700+ approx. ¥2,000/month
  2. 2 GB Xi and additional data-only SIM: ¥3,500+¥800/month ¥2,400
  3. 5 GB Xi and additional data-only SIM: ¥5,000+¥800/month ¥2,400
This would work out to monthly costs of at least ¥7,700 for the current set up of docomo + b-mobile, a minimum of ¥4,300 ¥5,900 for the 2 GB share plan, and ¥6,300 ¥7,400 for the 5 GB share plan. (Each additional shared line costs ¥1,700 for the "data plan," ¥500 and the ISP fee, which is ¥200 for the cheapest Mopera U plan.)

The outcome

See this new post for new results taking into account the data plan cost.

Below are the results of performing 100,000 simulations using the PDFs shown above. In 62% of the simulations, the 2 GB plan (red) works out to be less expensive than the 5 GB plan (green), but on average, only by a very very tiny amount (¥40/month!). The cost of having two separate plans from b-mobile and docomo jumps every four months, reflecting the recharge interval of the FAIR SIM.

Outlined below (from the least expensive over 2 years) are the three ways to proceed:
  • ¥140,000 (Both the 2 GB and 5 GB plan split across two devices)
  • ¥170,000 (General cost for the 2 GB or the 5 GB and the FAIR SIM (not shown)
  • ¥185,000 (Cost of 7 GB plan and FAIR SIM — status quo)
Not surprisingly, continuing to pay for two separate data plans has zero chance of being less expensive, and the total potential savings of combining the two devices onto one data plan is over ¥40,000 — enough for a new Nexus phone/tablet after 2 years. Though the 2 GB has a slightly higher chance of costing less in total, the mean cost of the 2 GB and 5 GB plans is virtually identical.

The primary thing that I learn from this exercise is that my usage really fits neither the 2 GB plan nor the 5 GB plan; something in the middle (that doesn't exist, probably for this exact reason) would be the most effective. I am unlikely to exceed the 2 GB quota often enough to make the 5 GB plan less expensive. This indicates that If I made a conscious effort to reduce usage, I could probably save an additional ¥10,000 over 2 years (based on the standard deviation of the 2 GB result). On the other hand, I could continue using my devices as I do now, without really caring at all about how much data I consume. I could even increase my usage and still save money.

Friday, May 2, 2014

Determining which data plan is best for you

It can be difficult finding a data plan that best fits your personal usage. If you get one that’s too large, you waste money each month paying for unused data. Too small and the charges for additional bandwidth quickly add up. If a carrier offers few to no choices, it’s probably not that difficult to determine which data plan provides you with the best value, especially if your data usage is relatively constant each month. However, when there are a number of choices, together with sharing between family members and devices, the decision becomes less straight forward.

WARNING: Serious Geekery follows. Proceed at your own risk.


Because NTT Docomo is radically changing their data plan offerings this June, there is serious potential to save money, especially if you are currently paying for multiple people and/or devices. In this post, I’ll describe how I evaluated which plan was most likely to cost me the least amount of money over the next two years. You can easily get a rough idea by just looking at your past data consumption and calculating the monthly cost for any particular data plan after factoring in overage charges. However, I want to consider how longterm cost is affected by variable monthly usage. I also want to consider the variability in data consumption among multiple devices all drawing from the same shared data plan.

So I created a framework that can scale across multiple scenarios. I’ll describe the most simple scenario below, which is a single person with one device. Examples of more complicated scenarios are a phone and a data-only tablet sharing a 2 GB or 5 GB data plan, a family sharing a 10+ GB data plan, or a small business sharing a large corporate data plan.

To do this requires:
  • Knowledge of your past usage
  • Informed assumptions on future usage
  • A large number of simulated potential futures
  • Some form of decision making regarding purchasing additional data
The actual question I will ask is this: Which data plan for me (the 2 GB, 5 GB, or 7 GB) is most likely to result in the lowest total cost over two years?

Past usage

Unfortunately for me, billing went paperless (if you pay by credit card) in January 2013, and the my docomo page only shows the usage for the past 3 months. (My phone only also stores 3 months of mobile data consumtion.) This means that I don’t have information regarding my full history of LTE data usage, so I’ll just have to make do with what I have. Below is my monthly data consumption shown as a time series on the left and as a histogram on the right.

I could use this “as is” as a predictor of future usage because I don’t really expect there to be many changes. There will be months when I use a lot of data, and there will be months when I don’t. However, I recall that I used nearly all of my current 7 GB quota at least once in the past, which must have happened during the period for which I have no information. So I will need to factor this into to my prediction of future usage.

Probable future monthly usage

I found it easiest to create a probability density function (PDF) based on the characteristics of my actual usage but including two additional months of 7 GB usage, which I have set as the maximum.

The PDF above describes the probability of using any particular amount of data during any given month. There is zero probability of using zero data. This is because I have not been outside of Japan for an entire billing cycle. Probability rapidly climbs to just over a 20% chance of using between 3 and 4 GB during a month. Probability then declines slowly to less than a 5% chance of consuming 7 GB.

I can generate potential future data consumption values from this PDF. I can randomly draw 24 values and consider it a sort of prediction of the next two years, but this will represent only one particular outcome. What I really need to do is to simulate thousands of potential futures. The mean value will of course converge on the mean of the PDF but I’m not concerned with mean — I can figure that out without simulating anything. I want to know about the potential for extreme values, which directly determines the cost of overages (or the amount of data I waste each month with a plan that is bigger than I need).

Estimating monthly cost from predicted usage

Once you exceed your quota, you have two choices: 1) live with 128 kbps until the end of the month, or 2) buy more high-speed data. Decision making regarding this is driven by a number of factors, the most important of which is probably how close you are to the end of month. I think most people would be reluctant to buy 1 GB of data when there is only one day left in the month. This of course could be overridden if a certain situation (e.g., job related) demanded a high-speed mobile connection RIGHT NOW.

I could attempt to simulate the decision making process around whether or not to buy more bandwidth, but it would really just be a bunch of BS that I pulled pretty much out of thin air.

Instead, I will set it up so that whole GB amounts always result in the purchase of additional bandwidth. Fractional amounts only result in an additional purchase if there would be more than 4 days remaining in the billing cycle (I did pull 4 days out of thin air). The number of days in the month remaining was estimated by uniformly distributing the total monthly usage amount across the entire month, i.e., daily usage is the total divided by the 30 days. This is best explained with an example.

Let’s consider that a value of 5.25 GB is drawn for a particular month. This is 3.25 GB in excess of the 2GB quota. The first 3 GB generates ¥3,000 additional data charges. If the 5.25 GB was used evenly over a 30 day month, this would be 0.175 GB per day. The remainder of 0.25 GB represents less than two days, and in this simulation, no additional data are purchased. The 0.25 GB are essentially thrown out, and the user struggles though 1.5 days at 128 kbps. The monthly cost would be ¥6,500 with the 2 GB plan and ¥5,000 with the 5 GB plan.

And the least expensive one is…

The 2 GB plan, FOR ME. This cannot be applied to anyone else unless their usage habits are exactly like mine. In the figure below, blue shows the results for the 7 GB plan, green for the 5 GB, and red for the 2 GB. The primary graph is the cumulative cost. The dots are the mean of all 100,000 simulations, and the error bars shows the standard deviation. The lower right bar graph shows the (mean) total after two years (i.e., where lines stops in the upper right).

Because I have set 7 GB as the maximum, the potential total cost of the 7 GB plan does not vary during simulation and would cost a total of ¥136,800 over two years. The cost of the 5 GB and especially the 2 GB plans is variable across simulations. From the start until 24 months, the mean cost of the 2 GB plan is always lower than the 5 GB plan, but there is a possibility, that by chance alone, the 2 GB plan could actually cost more. You can see that the uncertainty in the 2 GB plan is quite large, and if many month’s data usage was actually drawn from the upper limit in the range of values, the cost would exceed the 5 GB plan. I estimate that the chance of this happening is rather low (but not so low as to be completely discarded). As shown in the upper left, in 76% of all simulations (76,000), the 2 GB plan resulted in a lower total cost. The reverse occurred only 26% of the time.

So based on this, I would have a reasonable chance of saving a modest amount of money over the next 2 years with the 2 GB plan, especially when you consider that I am free to modify my behavior if it seems I may exceed my quota.

Scaling to a large number of devices

I worry that most of you haven’t even made it this far, and those of you who did are probably saying “wut?” I can expand this to consider multiple devices sharing data, adding another simulation for each device and adding up the results. For example, I also have a data-only device that currently uses a b-mobile Fair SIM. I also have a good idea of how much data that device consumes, so I can sum the total data consumed between both devices to see if it would be cheaper to cancel the Fair plan from b-mobile and get a second Docomo SIM that shares my data quota. In this case, I can already imagine that the chances of the 2 GB plan being the cheapest would be reduced, but since the Fair plan is designed for little usage (on average 250 MB/month), it still could be in my best interest to get the 2 GB plan.

If there is enough interest in seeing the results of this, I can make another post considering sharing between devices, family members, or small business employees.