Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

In Matlab, where one is generally compelled (for better or worse) to think in terms of array operations, the obvious code would be:

plot(mean((cumprod(randn(100,1000) .* 0.03) .* 15))

Well, that is assuming one wants a line plot of the mean value of the "location" at each time point across the population of walks. Personally, I find R's rather idiosyncratic approaches to data handling and function wrangling a bit hard to digest.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: