Live data from Hacker News

Statistical Physics with R: Ising Model with Monte Carlo

github.com

21–30 of 70 posts

Re: Statistical Physics with R: Ising Model with Monte Carlo

#21
post #10
post #3

Earlier quoted context omitted.

I wonder how close R was to also take over the scientific computing/machine learning space, instead of Python's numpy/scipy ecosystem.

It was never close. Its synthax is unintuitive and painful to learn as a science undergrad. If it hadn't been python it would have been another language.

Python's rapid adoption really came out of NumPy, SciPy, Matplotlib copying the interfaces from MATLAB, which was very widely used before but obviously had a cost associated.

Re: Statistical Physics with R: Ising Model with Monte Carlo

#22
post #3

R ecosystem provides amazing reproducible research ecosystem, even for statistical physics.

I wonder how close R was to also take over the scientific computing/machine learning space, instead of Python's numpy/scipy ecosystem.

The issue with R is that there is too much dsl. This is great for one-off analysis but makes building a cohesive large code base really difficult.

Re: Statistical Physics with R: Ising Model with Monte Carlo

#23
post #3

Earlier quoted context omitted.

I wonder how close R was to also take over the scientific computing/machine learning space, instead of Python's numpy/scipy ecosystem.

I love and use R, but it never became the dominant ML in part because it has three (or more) different object systems and many libraries sort of use their own style. This makes it seem a bit disjointed, in a way that other languages don’t. The R community should have anointed one object system and made tidyverse a core part of R. All that said, R is fantastic and the depth of libraries is extensive. Libs are often wr…

The developing S7 object system (https://github.com/RConsortium/S7) is looking fairly promising in that it combines many of the nice properties of S3 and S4 (validation, multiple dispatch, sane constructors) while still being fairly simple and straightforward to use.

Re: Statistical Physics with R: Ising Model with Monte Carlo

#24

Anyone can recommend a good and straightforward to understand -- general -- tutorial or book in Monte Carlo methods, for beginners?

The "Monte Carlo" term is deceivingly fancy, most algorithms with that label simply involve randomly picking from a set of possibilities (search space), as opposed to trying all cases or exploring in some other systematic way.

When you try do that for real problems, it can sometimes be difficult to sample from complex probability distributions/models efficiently in a way that is representative. There are lots of tricks around that, like most topics it's a black-hole of details. But it still boils down to randomly testing options.

Look at the source code, even in C it's really short and simple: https://github.com/msuzen/isingLenzMC/blob/master/src/isingL...

Statisticians like to do this kind of intellectual inflation, there are many such scary terms with simple meanings: "Markov Chain" is a process who's next state depends only on the current state, "stochastic" is a straight-up synonym for "random"... Illegitimi non carborundum!

Re: Statistical Physics with R: Ising Model with Monte Carlo

#25
post #4

Earlier quoted context omitted.

One general purpose web framework away

I disagree. R is just not a very nice language. It has some really great statistical and data science packages that were well ahead of the competition 10-15 years ago. The web frameworks were good enough for dashboards and what most people were using R for. But if you wanted to write fast and elegant nom-vectorized code, R is really lacking. I left it for Julia for that reason.

I agree somewhat with you - nonetheless a FastAPI + Alembic + SQLAlchemy alternative in R would make it possible to use it as a general purpose language

Re: Statistical Physics with R: Ising Model with Monte Carlo

#26

Anyone can recommend a good and straightforward to understand -- general -- tutorial or book in Monte Carlo methods, for beginners?

I think there is a "correct" answer to this question! The best book on Monte Carlo methods is this one: https://artowen.su.domains/mc/

It's not published yet, but already a classic. (Might be more intermediate than beginner, though.)

For something a bit more gentle, I also recommend chapter 29 of this book: https://www.inference.org.uk/mackay/itila/book.html

Re: Statistical Physics with R: Ising Model with Monte Carlo

#27
post #7
post #3

Earlier quoted context omitted.

I wonder how close R was to also take over the scientific computing/machine learning space, instead of Python's numpy/scipy ecosystem.

R is really not for production deployment. It lacks a lot of what made python popular, and its target users were radically different.

It's general purpose and really there is no issue with doing production with it really outside of the mindset and the lispy nature of it. Source - was working on R in production for financial sector.

Re: Statistical Physics with R: Ising Model with Monte Carlo

#28

Anyone can recommend a good and straightforward to understand -- general -- tutorial or book in Monte Carlo methods, for beginners?

I recommend starting here: https://youtu.be/nKCT-Cdk0xY

Once you understand and use this approach, you can figure out most other approaches you need to use.

Re: Statistical Physics with R: Ising Model with Monte Carlo

#30
post #10
post #3

Earlier quoted context omitted.

I wonder how close R was to also take over the scientific computing/machine learning space, instead of Python's numpy/scipy ecosystem.

It was never close. Its synthax is unintuitive and painful to learn as a science undergrad. If it hadn't been python it would have been another language.

This is obviously a personal thing but tidyverse syntax is great and lends itself very well to clear and concise data operations.
Post reply on HN