Least Squares Estimate Using a Monte Carlo Method

Using normally distributed errors with a high variance and a simple linear regression model, this Demonstration performs a Monte Carlo study. The frame on the left shows the response variables for a sample from the error distribution on the vertical axis. Joining each response visually captures the high error variance. You can set the sample size () for the exogenous variable, but these stay fixed for each drawing of the error term. So on the horizontal axis you can see the sample size () of the exogenous variable, which is shown as a number () of fixed 's.
In the frame on the right, an estimate is made of the true slope and intercept for each repeated random sample. It is well-known that the covariance between intercept and slope estimates is negative. In this frame, you can observe this well-known relationship by observing the general motion of the "blue dot" as you vary the sample size and repeated random samples.


  • [Snapshot]
  • [Snapshot]
  • [Snapshot]
    • Share:

Embed Interactive Demonstration New!

Just copy and paste this snippet of JavaScript code into your website or blog to put the live Demonstration on your site. More details »

Files require Wolfram CDF Player or Mathematica.