Download Homework 4

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Karhunen–Loève theorem wikipedia , lookup

Normal distribution wikipedia , lookup

Student's t-distribution wikipedia , lookup

Chi-squared distribution wikipedia , lookup

Law of large numbers wikipedia , lookup

Transcript
Homework 4
1. Use Matlab to generate a time series of Gaussian sequence xi with
specified mean  x and standard deviation  x .
2. Use Box-Muller transformation to generate two independent Gaussian
sequences through input two independent uniform distributions
generated by yourself.
3. Verify your results by using sample mean and standard deviation
ˆ x 
ˆ x 
1
N
N
x
i 1
i
1 N
( xi  ˆ x )2

N i 1
4. Repeat problem 1 and 3, by generating a time series of uniform sequence
with specified range.
5. Discussion on your results.
Notes:
(1) 1-D Gaussian distribution is given as p ( x) 
1
( x   )
exp[
].
2
 2
2
x
2
x
x
(2) Probability in the rang [ a , b ] is P(a  x  b)  a p( x)dx
b
MATLAB function:rand(),randn(),hist()
Appendix:
Box-Muller transformation
The Box–Muller transform is a pseudo-random number sampling method
for generating pairs of independent, standard, normally
distributed (zero expectation, unit variance) random numbers, given a source
of uniformly distributed random numbers.
It is commonly expressed in two forms. The basic form as given by Box and
Muller takes two samples from the uniform distribution on the interval (0, 1]
and maps them to two standard, normally distributed samples. The polar
form takes two samples from a different interval, [−1, +1], and maps them to
two normally distributed samples without the use of sine or cosine
functions.Suppose U1and U2 are independent random variables that
are uniformly distributed in the interval (0, 1]. Let
and
Then Z0 and Z1 are independent random variables with a standard normal
distribution.The derivation is based on the fact that, in a two-dimensional
Cartesian system where X and Y coordinates are described by two
independent and normally distributed random variables, the random
variables for R2 and Θ (shown above) in the corresponding polar coordinates
are also independent and can be expressed as
and
Because R2 is the square of the norm of the standard bivariate
normal variable (X, Y), it has the chi-squared distribution with two degrees
of freedom. In the special case of two degrees of freedom, the chi-squared
distribution coincides with the exponential distribution, and the equation
for R2 above is a simple way of generating the required exponential variate.