« first day (2822 days earlier)      last day (400 days later) » 

12:15 AM
@LuisMendo says the guy using bels and volts and whatevers all the time :P
 
 
10 hours later…
10:29 AM
hm was just looking it up again: In german "noetersch" is frequently lower case, but upper case in english, while "Abelsch" is uppercase in german, but lower case in english
ah wait, in the german wikipedia they write "Abelsche Varietäten" but otherwise they write "abelsch" lower case
ok no idea who is making the rules
 
 
1 hour later…
11:42 AM
@AndrasDeak--СлаваУкраїні You're totally right... so used to those that I didn't think about it :-) In fact, most electrical units seem to be people's names
@flawr Speaking of German: it fascinates me that you guys distinguish between Nummern and Zahlen. I know the difference, but is it always clear cut to you which one to use? For example, when children learn "the numbers" (their name and order), are they learning die Nummern or die Zahlen?
 
12:26 PM
@LuisMendo I've never thought much about this! Intuitively it is always clear which one it is, I think as a rule of thumb whenever you have some kind of enumeration, it is a Nummer, but for everything (especially also computations or for indicating an amount) it is a Zahl.
so your bank account, your cars chassis, your identity card, a runner in a race, a scene in a screenplay etc all have numbers
yes I think that might be the easiest way to distinguish them
 
 
4 hours later…
4:33 PM
@flawr and those would be Nummern, right?
So when small children learn the names of the numbers / how to count, would that be Zahlen?
 
4:52 PM
@flawr I knew a related challenge would show up soon :-)
 
exactly (d'oh, I was thinking numbers=Nummern :D)
 
5:24 PM
:-D
@CrisLuengo Looping is not what makes code slow in MATLAB (and hasn't been for a long time) It's true that loops are not as slow as they used to be, but I typically they are still slower than vectorization. About 8 times in this simple example:
>> A = randn(1e5,100);
tic
s = sum(A,1);
toc
s2 = zeros(1, size(A,2));
tic
for k = 1:size(A,1)
    s2 = s2 + A(k,:);
end
toc
Elapsed time is 0.011177 seconds.
Elapsed time is 0.089109 seconds.
Tested in R2023a with Matlab Online; similar results with my R2017b. I ran it several times for "warmup"
Putting the code into a function for better JIT optimization the factor goes down to about 4 in R2017b
Elapsed time is 0.006507 seconds.
Elapsed time is 0.028746 seconds.
...but it increases to about 12 in R2023b
Elapsed time is 0.001706 seconds.
Elapsed time is 0.021337 seconds.
 
5:48 PM
@LuisMendo almost all units are, really
 
6:09 PM
@LuisMendo Sure, you can still get a speedup by vectorization, but in general, if something is dreadfully slow, it's not because of the loops, it's because you're using eval, or the wrong algorithm, or whatever.
Your example is interesting. I'm guessing the 4x is because of parallelization in sum. In the latest few versions of MATLAB, sum was improved further by changing the order of computation: this made it faster and more precise.
I'm sure there's a blog post about that somewhere...
 
6:39 PM
@CrisLuengo Yes. I also noticed that max(abs(s-s2)) is 0 in R2017b, and something like 1e-11 in R2023b
 
 
1 hour later…
8:02 PM
@LuisMendo By the way, shame on you for using tic/toc to measure something so short... :)
I see a factor 20x in MATLAB Online:
A = randn(1e5,100);

t1 = timeit(@()sum(A,1))
t2 = timeit(@()foo(A))

t2 / t1

function s = foo(A)
s = 0;
for k = 1:size(A,1)
    s = s + A(k,:);
end
end
But indexing A(k,:) kinda sucks...
Humm... It's only a factor 15x with a double loop, adding scalars.
I think that difference is in better use of cache.
 
8:28 PM
@CrisLuengo I know, I know... laziness :-)
 
 
2 hours later…
10:38 PM
Thoughts?
0
Q: Use of $p_1/(p_1+p_2)$ to compare two probabilities $p_1$, $p_2$?

Luis MendoLet's say we want to compare two probabilities $p_1$ and $p_2$, not necessarily referred to the same population. For example, $p_1$ may be the probability of getting a certain disease conditioned on having been vaccinated, and $p_2$ the probability for non-vaccinated people. Common measures to co...

 

« first day (2822 days earlier)      last day (400 days later) »