I'm trying to calculate consumer surplus with integrate function in R.
PID = 2040;
integrand <- function(x) {320000*x^(-0.1)}
integrate(integrand, lower = PID, upper = Inf,
rel.tol=.Machine$double.eps^.05 )$value
Then an error shows "roundoff error is detected in the extrapolation table". If I change the exponent to -1, then no error shows and it emits a value. How can I fix the error with keeping the exponent value -0.1?
Thank you so much for your help in advance.
Try this,