Google Analytics had a self-hosted version, or more specifically Google Analytics was a self-hosted solution when it was Urchin before Google acquired it.
You could still get the self-hosted version for a price until Google killed it in 2012.
The reason Google doesn't want you to do this is simple: they want the data.