1

Given an array of length n, assuming there is a solution for the internal rate of return, what is the complexity of the numpy irr() function? irr() source code

I had a look at the code but wasn't able to calculate it myself.

Henry George
  • 504
  • 6
  • 19

1 Answers1

1

The algorithm seems to have complexity O(n^3), since it's computing the eigenvalues of the companion matrix of your input. None of the other computations in the function have nearly as long of a time complexity.

Rushabh Mehta
  • 1,529
  • 1
  • 13
  • 29