# Calculate the price of a european call option

To focus our ideas, we consider the quintessential example of a derivative contract in finance texts: We check this on the latest lognPDFwhich has the heaviest tail to the right: The usual way of dealing with this requirement is to split the domain of the function in regions with this behaviour and then putting them together.

We end this example by listing the steps of the method when applied to a general European derivative that is, one that is not path-dependent: Admittedly, Chebfun makes it look particularly simple. The possibility of making this change of measure guarantees the lack of arbitrage opportunities in the market i. We wrap the function handle in a chebfun constructor, specifying a right end point large enough for our calculations to be very accurate. MacKenzie, An Engine, not a Camera:

Construct chebfuns for each piece. The whole calculation we just did can be done analytically and the result is the celebrated Black-Scholes formula very similar expressions had been produced before by Sprenke and Samuelson, but without the key insight of changing the measure [5]:. We leave the interpretation of the different elements in this formula to another example, but we can use it now to check the accuracy of our calculation:. The answer of this question appears in every book of basic probability: As before, we have used the value RHS to specify the right end-point.

We end this example by listing the steps of the method when applied to a general European derivative that is, one that calculate the price of a european call option not path-dependent:. To calculate this value, first we use the cumsum command to obtain the cumulative distribution function CDF and then we evaluate it in the strike: We have not been able to locate references to a procedure like the one we present here but we wouldn't be surprised if one day we come across them, as it relies on little else than basic probability.

The possibility of making this change of measure guarantees the lack of arbitrage opportunities in the market i. Calculate the total probability of ending in constant regions and use them as weight of Dirac deltas located at points equal to the constant values. To focus our ideas, we consider the quintessential example of a derivative contract in finance texts:

A call option on an asset following a GBM To focus our ideas, we consider the quintessential example of a derivative contract in finance texts: Construct chebfuns for each piece. How can we calculate the distribution of a random variable which is itself the function of another random variable? Our choice for the right end-point should make the area under the curve very close to 1. To calculate this value, first we use the cumsum command to obtain the cumulative distribution function CDF and then we calculate the price of a european call option it in the strike:

In our particular setting, if the stock price is, for example, at 50, we would say that the option is OOM, and if it is at we would say that it is deep ITM, highlighting in this way that its is to the right, far from the strike. The new measure is known as the "risk-neutral measure" and is equivalent in some sense not discussed here to the original one. The usual way of dealing with this calculate the price of a european call option is to split the domain of the function in regions with this behaviour and then putting them together.

We check this on the latest lognPDFwhich has the heaviest tail to the right: The final step for the pricing of the call option is the calculation of the expected value of the distribution we just obtained:. As before, we have used the value RHS to specify the right end-point.