|
R demos
Back to all R demos
Comparing estimators in Uniform distribution
You can try out the function I used in lecture 10 to demonstrate estimation of the population median in a U(0,theta) distribution.
- Download this file: unif.ests.R to your computer, and save it (as unif.ests.R)
- Start up R in the usual way
- In R, using the Source R code command (on the File menu), navigate to the appropriate folder, and select the file unif.ests.R
- Run the demonstration by typing unif.ests()
- The function displays a sample of size 10 from the Uniform(0,theta) distribution with theta= 3, together with the three estimators of the population median discussed in lectures
- You can control the display with the mouse and pointer
- You can exit the function by clicking below the horizontal axis
- If you click anywhere else, a fresh sample is drawn
- To change the values of n or theta, run the function by typing apprpriate arguments to the function - the full syntax is unif.ests(n,theta)
- If you are interested in seeing how this is all done in R, and perhaps even modifying the actions, you can view the function by simply typing its name (without the () afterwards)
|