- your own library, sure, but decide which level you are going to start at. you probably don't want to write your own root finding procedure; knowing the math and one semester of programming is enough to know to find the right function in a library. similarly, you don't want to write a routine to (carefully) integrate at the tails of a normal distribution so you can evaluate p or the cdf out there. i suggest starting with a matrix alg package and a random number package.
- yea there can be license issues. big companies generally allow use of GPL2, MIT and BSD in that they are the most commercial friendly licenses. GPL3 and other copyleft licenses are not viewed as friendly since companies generally don't like to contribute to society without financial incentive.