Borrar filtros
Borrar filtros

How to fit a distribution whose parameters depend on other parameters?

29 visualizaciones (últimos 30 días)
Sergey Abaimov
Sergey Abaimov el 3 de Jul. de 2024 a las 11:49
Editada: Torsten el 3 de Jul. de 2024 a las 18:35
Hi!
How to fit a distribution is clear, in dfittool for example. An example is a gas at a fixed temperature T. A priori, the distribution of Vx velocities of its molecules is proportional to exp(-mVx^2/2kT). If I know the velocity Vx of every molecule, I will fit normal distribution to data containind Vx and will obtain normal fit with zero mean and standard deviation proportional to T (variance kT/m).
But how to fit a distribution whose parameters depend on other parameters??? An example - a gas in a volume in a gravity field with gas temperature depending on height T(z). Now every molecule has its own height z, and my data look like (Vx,z). Do I have a function to feed such data to it? I mean, to fit a normal distribution exp(-mVx^2/2kT(z)) to data, getting in the result T(z)?
The question is related to another distribution and another system, I used normal and gas as an example. The question is more general whether distribution fitting and curve fitting can be done at one step.

Respuestas (1)

Torsten
Torsten el 3 de Jul. de 2024 a las 12:40
Editada: Torsten el 3 de Jul. de 2024 a las 12:42
In this case, you must assume a parametric expression for T(z) as well (e.g. T(z) = a + b*z) and add a and b to the parameters to be fitted.
And be careful to put the denominator into brackets - so use
exp(-m*Vx^2/(2*k*T))
instead of
exp(-m*Vx^2/2*k*T)
in MATLAB.
  2 comentarios
Sergey Abaimov
Sergey Abaimov el 3 de Jul. de 2024 a las 14:08
Thanks for the answer, but I do not get it. For curve fitting, yes, clear. But how do I feed additional parameters to distribution fitting?
How do I tell that x above are pairs (Vx,z). How do I put T(z) = a + b*z as Name and Value? Can you refer to an example?
Best regards
Torsten
Torsten el 3 de Jul. de 2024 a las 18:31
Editada: Torsten el 3 de Jul. de 2024 a las 18:35
Sorry, I was in the realm of curve fitting, not distribution fitting.
If your data look like (Vx,z), I think a multidimensional Gaussian would be the way to go:
This model can even handle the case that Vx and z are correlated.
Or is only Vx a random variable and z is deterministic ?

Iniciar sesión para comentar.

Categorías

Más información sobre Curve Fitting Toolbox en Help Center y File Exchange.

Productos


Versión

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by