I'm assuming the resolution of Namespace is a build time dependency rather than runtime, as it is unlikely to change dynamically. You can therefore add a static reference to the Package Namespace, rather than attempting to resolve at runtime.
Navigate to Setup > Installed Packages
Click on the Package you've installed and are referring to. You will be able to see the Namespace Prefix here. Use this when referencing the page.
So if the Namespace Prefix is PKG and the VF Page is called VFPage, the URL should be