Calculate the Area under a Curve
问题 I would like to calculate the area under a curve to do integration without defining a function such as in integrate() . My data looks as this: Date Strike Volatility 2003-01-01 20 0.2 2003-01-01 30 0.3 2003-01-01 40 0.4 etc. I plotted plot(strike, volatility) to look at the volatility smile. Is there a way to integrate this plotted "curve"? 回答1: The AUC is approximated pretty easily by looking at a lot of trapezium figures, each time bound between x_i , x_{i+1} , y{i+1} and y_i . Using the