1

I want to find a point estimator for median and mode of samples of a simulation. I know the mean has a form like this :

$\overline{X}_n = \frac1n \sum_{i=0}^{n} X_i $

i have found this equation on this forum : Best estimator for median

$\sum_{i=0}^{n}|X_i - s|$

but i don't know how to put it into practice in simulation. can anyone help with it?

  • Can you say where you´ve found the term? The context is not really obvious. – callculus42 Jun 27 '19 at 13:57
  • @callculus We have done simulation and now we have some samples $X_1,X_2,...,X_n$ and we want to find the median of the whole model by simulation,got it? – Peyman Tahghighi Jun 27 '19 at 14:10
  • More or less... But what about "i have found this equation on this forum" ? Where have you find it? – callculus42 Jun 27 '19 at 14:17
  • @callculus i'm so sorry i edited the post. – Peyman Tahghighi Jun 27 '19 at 14:22
  • Thanks for clarifying this. What I still do not understand: You have made a simulation and want to make a simulation again? That´s not clear. – callculus42 Jun 27 '19 at 14:24
  • @callculus No,I want to estimate the actual median by using a limited number of samples like what i did with mean. – Peyman Tahghighi Jun 27 '19 at 14:26
  • You can use linear programming. Here you can see how to handle absolute values. – callculus42 Jun 27 '19 at 15:36
  • (1) Title says median and mode. Is 'mode' typo for 'mean'. Don't see mention of mode in text of Q. (2) The eqn for median in the link is a property of the median. Not the definition and not an efficient way to find median. // In R, you can find median of a vector x with median(x); its mean with mean(x). Median requires some sorting, so for huge sample median(x) can be a bit slow. – BruceET Jun 28 '19 at 05:00
  • @BruceET Thank you but I don't want implementation I just want an estimator that is unbiased. – Peyman Tahghighi Jun 28 '19 at 06:17
  • 1
    Well then, the sample median is an unbiased estimator of the population median. There is a "CLT" for medians which requires that the population density be non-zero at the median. // However, even though unbiased, the sample median need not be the best estimator of the population median: For normal dist'n , population mean and median are the same. Sample mean has smaller variance than sample variance. – BruceET Jun 28 '19 at 23:01

1 Answers1

3

The median is the value such that half of the density of above and half is below it.

To find the empirical median you put the data in a long vector. Then you sort the vector. The element in the middle of the vector is your empirical median (if there is an odd numer of elements). If the number of elements is even, the median is the average between the two central elements of the vector.