Both sides of the equation (11.96) can be left multiplied by the transpose matrix
AT and the resulting system can be solved for the unknown coefficients. In matrix
notation write
Aβ=y
ATAβ=ATy
β=(ATA)−^1 ATy.
(11 .97)
The solution of the system of equations (11.95) or (11.97) will produce the coeffi-
cients βi,i= 0, 1 ,.. ., k , which minimizes the sum of square error.
Monte Carlo Methods
Monte Carlo methods is a term used to describe a
wide variety of computer techniques which employ ran-
dom number generators to simulate an event or events
and then perform a statistical analysis of the results.
Sometimes Monte Carlo methods are constructed to
solve difficult problems where deterministic methods
fail. If performed properly, Monte Carlo methods can
give very accurate answers. The only drawback is that some Monte Carlo techniques
take a very long time to run on the computer.
An example of a simple Monte Carlo method is the calculation of the area Aof
a circle using random numbers. Consider a circle with radius 1/2 which is placed
inside the unit square having vertices (0 ,0),(1 ,0),(1 ,1) and (0 ,1). The area of this
circle is π/4 = 0. 7853981634 ....
Most computer languages have a uniform random number generator which gener-
ates pseudo-random numbers lying between 0 and 1. Construct a computer program
which employs the uniform random number generator to generate two random num-
bers (xr, y r), where 0 < x r< 1 and 0 < yr< 1 , then imagine the circle inside the unit
square as a circular dart board and the random number generated by the computer
program (xr, yr)is where the dart lands. Construct the computer program to perform
a test as to whether the point (xr, yr)is on or off the circular dart board. Perform
this test N-times and record the number of hits which land on or inside the circle. To
calculate the area of the circle assume the ratio of hits inside circle to total number
of points generated is in the same proportion as the area of the circle is to the area
of the square. One can then use the ratio
Number hits inside circle
Total number of darts thrown
=
Area of circle
Area of square