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?
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.