How to fit data (x,y) with log-normal distrubition and not constant mu and sigma

5 vues (au cours des 30 derniers jours)
derecho
derecho le 25 Nov 2017
I want to fit a data (x_i,y_i) using lognormal distrubition. Sigma(x_i) and mu(x_i) are not constant but they are at each point (x_i,y_i) known. How can fit the curve?

Réponses (4)

Image Analyst
Image Analyst le 25 Nov 2017
I don't think you can. I mean, if your distribution parameters are varying all over the place for each and every sample, then how can you fit a single distribution to it? You'd essentially need to have a new log-normal distribution for each and every point, but you can't get that from just a single data point. I think you need to re-think what you want, or how you're asking it.

Jeff Miller
Jeff Miller le 25 Nov 2017
I do not understand what you mean when you say, "I want to fit a data (x_i,y_i) using lognormal distrubition".
To "fit" usually means to estimate some unknown parameter values (e.g., mu and sigma for lognormal). But it sounds like you already know all of the parameter values, because you say "Sigma(x_i) and mu(x_i) are not constant but they are at each point (x_i,y_i) known." If they are known, you don't need to fit them.
Could you explain more about what you are actually trying to compute?

Aymen Ben Mansour
Aymen Ben Mansour le 26 Nov 2017
I have a given data (x_i,y_i). mu(x_i) and sigma(x_i) are functions with unknown parameters: mu(x_i)=C_1 + C_2*(log(x_i)), sigma(x_i)=C3*exp(x_i).
I already found the unknowns parameters C_1, C_2 and C_3 with maximum likelihood and now i have for each sample mu and sigma known.
I want to plot the curve which estimates curve of the samples (x_i,y_i).
Thank you!
  2 commentaires
Image Analyst
Image Analyst le 26 Nov 2017
Try the plot() function.
derecho
derecho le 26 Nov 2017
Plot what exactly ?
I think: Plot(x,y) with x=x_i and y = [f(mu_i,sigma_i)], f ist the pdf of lognormal distribution. Right ?

Connectez-vous pour commenter.


Jeff Miller
Jeff Miller le 26 Nov 2017
I am still not sure that I understand the question, so let me summarize my interpretation:
You have a set of (x_i,y_i). For each x_i, you imagine that there is a lognormal distribution with parameters that you know how to compute. Each y_i is a random sample from that lognormal distribution.
You would now like to compute the overall predicted frequency distribution of the y_i's. That is, you would like to compute for each possible z (in some range) the predicted pdf(z). Your question is how to do that.
If the above interpretation of the question is correct, then here is a suggested answer:
The predicted pdf(z) can be computed for each point z by averaging the pdf_i(z) values across i=1:n [where n is the number of (x_i,y_i) pairs]. Each pdf_i(z) value is the pdf(z) for the lognormal(mu_i,sigma_i).
To visualize this, imagine that you plotted all n of the lognormal(mu_i,sigma_i) pdf's on a single plot, with z on the horizontal axis. For each z, you could compute the average height across the n plotted pdfs. That average would be the overall predicted height of the pdf(z).
Formally, the resulting pdf is called the pdf of a "mixture distribution". In this case, you are mixing n lognormal distributions whose parameters you are computing from the x_i values.
Note that in this characterization of the problem the x_i values are fixed constants, not random variables. If you actually conceive of the x_i's as coming randomly from some distribution of their own, then the full predicted distribution of y's would have to be based on the full distribution of possible x_i's, not just the x_i's that you happened to get in your sample.

Community Treasure Hunt

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

Start Hunting!

Translated by