This question is probably stupid, but I've been trying to figure this out for hours and I still couldn't find anything about it. Probably I'm just too lost.
So basically, I'm analysing an algorithm by doing an asymptotic and experimental analysis. The asymptotic analysis went well and I concluded that my algorithm is $O(n\log n)$. The problem is the experimental analysis. Firstly, I did some tests to get the time taken for each input. For example:
$n = 1, t = 0 | n = 2, t = 2 | n = 4, t = 8 | n = 8, t = 24 | n = 16, t = 64 | n = 32, t = 160 (...)$
If I do the graph with this example, I can see that it is an O(n log n)/linearithmetic graph, but how do I prove it? Do I have to calculate the order of growth? If so, how do I do it?
Thanks for the help!
You can try to see (e.g., by plotting) if the function $\frac{T(n)}{n}$ has a logarithmic growth (to reduce the number of hidden constants, instead of checking $T(n)$ itself).
For example, you can try to use non-linear least square curve fitting (e.g., with R) and fit a logarithm function (of the form Const + A * log(n), e.g.,) and compare the growths. The following R code shows an example of the same on randomly generated time
You can also compute the distance (e.g., MSE, KL-divergence etc.) between the fitted logarithmic curve and the actual $\frac{T(n)}{n}$, to ensure that it's sufficiently small for large enough $n$.