Compute the hedge ratio between an asset "S" and a derivative on it "F"
h=hedge(S,F);
Given the historical prices of both an asset "S" and a derivative written on it "F", the function computes the so-called hedge ration "h". If one multiplies the wealth invested in "S" by "h", one obtains the wealth that must be invested in "F" in order to hedged the position on "S". The hedge ratio is the opposite of the inverse of the elasticity of the derivative with respect to the underlying asset.
First we generate 100 log-normally distributed daily prices for an asset whose initial values is 25 euros. First step is the creation of 100 normal random variables (with mean 0.1/250 and standard deviation 0.2/sqrt(250))
-->M=grand(100,1,'nor',0.1/250,0.2/sqrt(250));
Then we create the prices
-->S=exp(cumsum(M,1))*25;
Now we create the prices of a derivative whose returns are more or less 5 times the returns on the underlying
-->F=(S/S(1)).^grand(100,1,'unf',4.9,5.1);
and so we are ready for using the function
-->h=hedge(S,F)
!N. observations 99 !
!N. variables 2 !
!R-square 0.9705684 !
!R-square corrected 0.9702650 !
!Coefficients t-statistics !
!-0.0001464 -0.1427691 !
!5.0436713 56.557729 !
h = - 0.1982683
The statistics show that the regression is good and the hedge ratio is reliable.
Francesco Menoncin - Brescia University - 2010