In R, the function constrOptim provides a set of optimization routines to solve linear inequality constraint problems conveniently. Different algorithms are available, for example, to use the Nelder-Mead algorithm, just set the input parameter gradient function to null.

# Microsoft Solver Foundation for Excel

The Microsoft Solver Foundation (MSF) provides a rich set of optimization library and a modelling framework, all in an easy to use GUI through Excel. To make it developer friendly, MSF made available its library through API implemented in several programming languages.

Using MSF in Excel is very straight forward, thanks to its well designed user interface. For example, in the classic shipping optimization example, the model inputs are grouped in parameters, constraints, and goals, and are presented in side tabs.

Comparison of Microsoft Solver Foundation and the built-in Excel solver can be found in a previous installment.

# Autocorrelation function

The autocorrelation function is the ratio of the k*th* sample autocovariance to the sample covariance, i.e.,

A plot of r_{k} against lag k is evaluated for discernible patterns, relationships, and absolute values (e.g., close to zero).

# Implied volatility in R

The R package RND computes the implied volatility for a Call option. A sample usage is given as below.

The implied volatility based on the Black-Scholes model differs from realized volatility in that the latter is a retrospective estimate of price, while the former provides insight into the future.

Realized volatility can be derived from more traditional approach like standard deviation and GARCH models. Implied volatility, on the other hand, must be found numerically because the Black-Scholes formula cannot be solved for phi in terms of other parameters. A previous installment provides more mathematical details in TI Nspire.

# Cryptographic roots in Blockchain technology

The Blockchain is expected to be the revolutionary technology to take the centre stage in our society where the traditional ledger system once dominates, from bitcoin that emerged in the finance sector to fields where transactions are dependent on authenticity, be it a paper document from bank, an import / export data exchange, or even documents in judicial systems, it is important to understand the principles of its fundamental roots in cryptography.

For example, to ensure the rightful spending of currency in bitcoins, there are a lot of technology being in place on the virtual money market. One being the Elliptic Curve Cryptography that is based on mathematics to ensure the identity of parties involved in any bitcoin transactions.

# Plotting gamma distribution in TI Nspire

The gamma function is not a built-in function in the TI Nspire. Nevertheless this function can easily be defined and used for visualising the gamma probability distribution function.

# Poisson prediction for soccer match odds

It is the World Cup season. There are many prediction models, and one of the most widely used statistical technique is the Poisson distribution:

The historic match results are available in the public domain, for example, at http://eloratings.net/. The data are analysed to obtain an index referred to attack strength or goal expectancy. This can further elaborates into more complex data like home team and away team expectancy.

By using a matrix of score scales, usually from 0 to 9, all possible outcomes under 10 goals per team are defined with the respective probability. An example matrix with scores from 0 to 2 will look like one below:

This is the basics of predicting soccer in a quantitative way using the Poisson distribution. There are of course many other prediction methods and models, including organic method like asking the famous Paul the octopus 🙂