« first day (2110 days earlier)      last day (1102 days later) » 

2:31 AM
@LuisMendo I’ve just read that page, and didn’t understand anything. Wikipedia pages for obscure things tend to be written for people that already know what the topic is about.
Anyway, it’s probably not something I’m meant to know about. :/
 
 
8 hours later…
10:10 AM
@CrisLuengo Yes, it's very specific. It's a distribution that is used in the design of a certain type of error-correcting codes
It only rang a bell for me because I had read some papers on those codes
 
11:08 AM
@CrisLuengo I read it but I don't think there's anything to understand there. It just defines the distributions.
 
 
3 hours later…
1:38 PM
I might have an XY question here... I'm trying to compare data from two histograms. I was following this neat guide, but it only mentions the normalization by 'pdf', and I was wondering if someone could point me to a resource to achieve the same thing but normalized by fraction of total, i.e. histogram(data,'normalization','probability'), which seems more intuitive to me. mathworks.com/help/stats/…
 
Didn't we recently have a discussion about the normalization types of hist()? :)
 
....yeeeess...
 
@user2305193 to compare two histograms, use this test: Kolmogorov-Smirnov
 
I got to the same test, thanks @Cris
I'm struggeling to get the function that fits the normalized data
 
@user2305193 I think the probability normalization doesn't make any sense here since we're talking about a continuous distribution (that is, we are considering a pdf)
 
1:48 PM
hm. I was afraid that would be the answer... I would guess this translates to, it would be more intuitive if you would read more about what pdfs are exactly
for the example data on mathworks they show ylims that kind of make sense to me
but for my data I get ylims with PDFs that are [0 8]
(ca 1000 values, ranging -1:1)
(that's when I plot the function)
thanks for the quick replies, I'll go with reading more about pdfs, and using the kstest2
 
well if you have a discrete distribution (e.g. that lives on the integers), then you can actually talk about a probability for each integer. However if you have a continuous distribution that doesn't make any sense: You cannot assign a positive probability to an uncountable amount of points. So pdfs to the rescue: What we can do is define probabilities for intervals. And instead of doing that for every possible interval, we just define the derivative with respect to the points.
To get back a probability for an interval we just integrate our pdf (the "derivative") over that interval.
 
processing...
 
So a (1d-usually) pdf is just a short way to assign probabilities for all possible intervals on the real line.
 
cool. I think I get it, that was super helpful
I'm hanging to explain the observation of the range [0 8] on the yaxis when I plot the data
 
Do you have a few minutes for an analogy? :)
 
1:56 PM
of course, I'm here to learn and understand better... and since I'm desperate after not getting it from various sources
(and, for a quick fix, if there were one)
 
Ok consier a 1m long stick (with constant round diameter). The stick is made of some kind of unknown material, and you notice that it feels a lot "heavier" on one side.
This means the material of the stick must have a greater density on one side right?
 
if it's the same material, I guess
/homogenous
 
yes it is not homogeneous, and it could be made from any combination of materials
So let us assume the stick is 1kg
Now we could mesure a linear density, in kg/m
 
linear referring to what exactly?
 
Let's call this density d (and the density in a specific place is d(x) for x in [0m, 1m]
to the length
 
2:00 PM
with you so far
 
so at each position x we have some kind of density
assuming we didn't know the total mass, but we just had the density function d, how can we compute the total mass?
 
is it the differential of all possible points?
i.e. d(x)'?
 
close but not quite: the density has the unit kg/m, but we are interstd in the total mass kg
 
d(x) times the mass then I guess
 
that would result ins omething of the unit kg^2/m
(m = meter)
 
2:05 PM
oh sorry, by mass I meant [m]
so length
 
but then we have a functino that gives us a mass for every point x, does that make sense?
we want one total mass
so the idea is that we can integrate the density to get the mass
so if we integrate d(x) with respect to x from 0 to 1 we get the total mass
let me write that as integral(d(x),x,0,1)
that is basically the definition of a density
 
ok. it makes sense.
 
[usually in mechanics we talk about volumetric densities because we consider 3d objects. and then it has the unit kg/m^3, an we have to integrate over volumes, which is a little bit more complicated but the idea is the same]
^ this is the expertly draw stick we are talking about
it is "heavier" on the left, and "lighter" on the right
this stick is made from two materials, a blue one, and a red one
(we assume these materials are homogeneous)
which of these two materials must therefore have a greater density?
 
would the mass be the equivalent of the sum of all possible points for d(x)
 
very close but not quite: if you assume each piont has a positive mass, then you have a problem because there are infinitely many points, right?
 
2:14 PM
can't we just discretize it and estimate our error somehow? =)
our measurements of the stick will always be based on observations, as long as it's a real stick that is
 
we can, this is basically what we do when we define an integral! :)
 
I see.
thanks for leveling with me here
 
so let's consider a small piece of width h
(the slice from x to x+h)
because the slice has a density that is close to d(x) we can say this slice has a mass of about d(x)*h
(if h is small the density around x cannot change a whole lot, that is, if it does change a lot in this slice, the error only affects this one slice, assuming this density is somehow "nice")
does that still make sense?
 
yes
 
so let's assume we divide the whole stick into N slices, that is h = 1/N
then the approximate mass of the total stick is
d(0)*h + d(1/N)*h + d(2/N)*h + d(3/N)*h + ... + d((N-1)/N)*h
 
2:20 PM
yeah, that's the integral
 
right
ok
so if red and blue hat the same density, then we must have d(x) = 1 kg/m for all 0 <= x <= 1 right? (since the total mass is 1kg)
now as I said before, let's say the right side is lighter, so red must have a smaller density (and blue therefore automatically a bigger density)
let's say the red part has a total mass of 0.2kg, (therefore the blue part has a mass of 0.8kg)
we said these are homogeneous, so the red as well as the blue both have a constant density
can you compute the densitiy for each of them? @user2305193
 
ok, so I'll try to explain my issue then with that stick analogy ^^. I take 10 measurements on that stick, then another 10 from the stick. Now I plot histograms of those two sessions, and want to ask, is the distribution of my data the same between the two sessions.
oh crap sorry, your msgs only arrived now
 
(wanna finish the analogy? it doesn't take much longer, I promise:)
 
nono I'm reading... not finishing
ok, so if .2 is the result of the integral of d(x), then I'd take the derivative of .2 with the same function to get the density of a specified segment?
*the specified
 
0.2 = integral(d(x), 0.333, 1)
the derivative of a number is just 0
but if we write F(x) = integral(d(x),x) then 0.2 = integral(d(x),x, 0.333, 1) = F(1) - F(0.333)
so F is (confusingly) also called the integral sometimes, but here I'd prefer the name antiderivative
if you differentiate F you get the back the density d
so since d(x) is constant, (let's say d(x) = c) on that segment 0.333 to 1
 
2:37 PM
let's
 
we know F(x) = c*x
so 0.2 = F(1)-F(0.333) = c*1 - c*0.333, therefore d(x) = c = 0.2/0.667 = 0.3
now to the very last point: what would be the density of the blue part then?
we already know it must be greater than 1!
in fact, d(x) = 2.4kg/m for x in [0,0.333]
so the density can be arbitrary high, even if the total mass is just 1kg!
similarly, the probability density function can be arbitrary high, even if the total probability must be 1
 
(not afk, thinking)
 
or alternatively: you can drive 150km/h for 1 minute, even if the total distance is a lot less than 150km
ok the last one was a little bit far fetched so maybe ignore it, but it still holds:)
 
that last example might have been more intuitive
 
ok, if we drive 1km in one hour, this could have been achieve by constantly driving 1km/h, or by first driving 100km/h for a small amount of time, and for the remainder of the hour drive a lot slower
 
2:50 PM
so what exaclty would we expect if we plot histogram(trip_measurements,'normalize','pdf'), where trip_measurements would be 100 randomly taken speed measurements?
(and we specify a bin width of 10 km/h)
 
so we're talking about one trip right?
 
yeah one trip, we make it 100km, so it takes 1h to get there at 100km/h
(imagine a race if that fits better I guess)
 
still let's do 1km, otherwise it doesn't make any sense
or let's first do 1km instead of 100km
 
ok?
 
so as we nomralze as a pdf the total area of all bins will be 1
that is 1km
(cause the width of the bins is in km/h and the height is in h)
each bin basically measures (or approximates) the amount of time we have spent travelling in some velocity range
so for that 1km range, we could maybe have travelled 200km/h for 0.005h and 0km/h for 0.995h
if we integrate over the whole histogram, we must get 1km
 
2:59 PM
ok. So even though the area is 1, the Y axis for individual bins can go higher.
 
yup!
 
would it be less than 1 in a normal distribution?
 
not necessarily
it depends in the std you define
normal distribution for different variances
 
ok. so what if I'm only interested in the fraction of time spent travelling at some velocity range
ok
I know that site, it's awesome
 
then you just pick the bin of you range, and look how high it is
 
3:04 PM
cool. that illustrates the point @desmos.com
I understand better now I think. But I guess what I wanted to look at the same data, but I'm now not interested in the absolute time in spent at a velocity range (i.e. the Y axis), but I want to normalize it by total time
thanks a lot @flawr
 
np
 
 
1 hour later…
4:29 PM
Every now and then we get an interesting question. I did some testing and the behaviour leading to the OP's findings is quite complicated; or so it seems to me. Maybe someonw can offer a simpler explanation?
 
 
1 hour later…
5:44 PM
@LuisMendo I can tell you found it interesting. That’s a very thorough exploration!
I bet it’s a bug. It can’t be like this by design.
 
6:01 PM
@CrisLuengo Thank you! I thought the same. It's too weird even for Matlab standards :-)
 
@LuisMendo finally an interesting question... and the asker is already in the room :P
 
The fact that you read tick labels, write them back, read again and get something different is really puzzling
@AndrasDeak Ah, I hadn't noticed. Those generic names don't make it easy :-)
 
yeah
the numbers together with the colour and general pattern of the avatar made me suspicious
 
Of what?
 
that the asker is this user*
they've been coming here for a while
 
6:04 PM
I see
 
6:50 PM
So, great question, @user2305193!
 
 
2 hours later…
8:23 PM
@AndrasDeak you brewing beer? madscientist.hu/en
It tastes very good :)
 
I'm sorry to say that being mad and being a scientist is insufficient to brew good beer
 
Hm.
You are both though. And Hungarian
I still suspect this to be a front for you
 
I actually know people in an experimental lab at our institute who also brew beer :D
 
14
Q: Why do MATLAB questions on Stack Overflow not tend to appear in the top of Google search results?

EJoshuaS - Reinstate MonicaSo, I recently started learning MATLAB for a course I'm taking and had the odd experience of having other Q&A sites (including MATLAB's discussion forum) routinely outrank Stack Overflow results (if there even was a Stack Overflow result at all). Irritatingly enough, these tend to be plagued by t...

In case anyone has any thoughts on this
@AndrasDeak Ha! See, I knew I was right.
BUt are you telling me you speak to experimental people?
 
nah, t'is a silly place
@Adriaan I did a test, searching for "matlab cell histogram" and the first non-matlab-answers hit is on SO, both in google and duckduckgo
based on empirical evidence I report that the effect is non-existent :P
 
8:40 PM
@AndrasDeak wrote an answer anyway
If it's off-point, I blame Hungarian Mad Scientists :P
 
 
2 hours later…
10:39 PM
@AndrasDeak yeah this user has a functional signature here, asking the most off-topic questions...
 

« first day (2110 days earlier)      last day (1102 days later) »