A Structural Network Formation Model and Its Application in R&D Networks