Re: Variance from pdf



R Ahmed wrote:

I have the pdf values at hand and I need to know the variance and
mean of the pdf. Please let me know how it is possible in MATLAB to
do so.

Hi -

This isn't a lot of information to go on. I guess what you mean is, "I have numerical values for the PDF f(x) at some (hopefully) large number of x values."

If that's really what you have, it seems like the best you can do is think of this as a stairstep approximation to the true PDF.

you can do one of two things:

1) compute the two moments analytically, or

2) generate a large number of random values from your PDF approximation, and compute their sample mean and variance as an approximation to the true moments. You should be able to do this pretty easily using RANDSAMPLE from the Statistics Toolbox, if you have that toolbox.

Hope this helps.

- Peter Perkins
  The MathWorks, Inc.
.



Relevant Pages

  • Re: weighted sum of independent beta random variables
    ... >> cdf of a weighted sum of independent beta random variables? ... >you should take into account in any approximation. ... >sum, and an exact formula for inverting this to get the pdf, but I ... in my question X_i's are beta random variables with parameters ...
    (sci.stat.math)
  • Re: The First Variation of a PDF
    ... the pdf is symmetric about x=0 and the pdf takes a very simple form. ... to assume the approximation is not negative. ... Since the support for fas a function of x is compact, ... pdf of fhas the same compact support? ...
    (sci.math)
  • Re: The First Variation of a PDF
    ... that is a function of a real parameter c. ... When c is non-zero, the form of the pdf is non-symmetric about x=0 ... One way I considered was to construct an approximation to the pdf: ...
    (sci.math)
  • Re: weighted sum of independent beta random variables
    ... Batu Chalise wrote: ... > cdf of a weighted sum of independent beta random variables? ... pdf of W? ... you should take into account in any approximation. ...
    (sci.stat.math)
  • weighted sum of independent beta random variables
    ... Is there any closed form expression or approximation for the pdf or ... cdf of a weighted sum of independent beta random variables? ... pdf of W? ...
    (sci.stat.math)