The best BRM advice I ever seen was this:
A good bankroll formula is
bankroll = comfort * SD^2 / WR
where comfort depends on your risk tolerance and ability/willingness to move down.
A comfort level of 2 is aggressive.
A comfort level of 4 is conservative.
SD is your standard deviation, which is reported by programs like
PokerTracker and Hold'em Manager, and it is typically about 90 big blinds/100 hands
for 6-max players who buy in full, but it depends on playing style. WR is your win rate.
For example, if you use a middle-of-the-road comfort level of 3, and your SD is 90 big blinds/100 hands,
and your win rate is 6 big blinds/100 hands, then your bankroll should be about
3 * 90^2 / 6 = 4050 big blinds = 40.5 buy-ins.
If your win rate is only 3 big blinds/100, then you need twice as many, or 81 buy-ins.
If your bankroll drops below this amount, it doesn't mean you have to stop.
However, playing with less than half of the recommended bankroll should be viewed as an expense.
Hope this helps.