Economics 618B: Time Series Analysis
Department of Economics
State University of New York at Binghamton
Problem Set #1
1. Generate
n
= 500
random numbers from both the uniform
1
b
−
a
(
U
[0
,
1]
, uniform be-
tween zero and one) and exponential
λ
exp (
−
λx
)
(set
λ
= 2
and let
x
∼
U
[0
,
1]
)
distributions.
Plot the histograms of each of the variables.
What are the true and
estimated means and variances?
2. Generate a random variable with
n
= 500
from the mixed normal distribution with
P
[
x
∼
N
(
−
3
,
1)] =
P
[
x
∼
N
(3
,
1)] = 0
.
5
. Plot the histogram. Note that this should
be a bimodal distribution. Do not add the two variables together. This will lead to a
unimodal density with mean near zero.
3. Generate a random variable with
n
= 500
from the Student-t distribution with 5
degrees of freedom,
t
5
. Plot the histogram.
4. Generate a random variable with
n
= 500
from the
χ
2
distribution with 1 degree of
freedom. Plot the histogram.
5. Generate a random variable with
n
= 500
from the Normal distribution with mean 1
and variance 0.5. Plot the histogram.
6. This problem will show you how the central limit theorem works. Using a programming
software show how the CLT works for the sample mean with the
fi
ve separate distrib-
utions. Use
n
= 10
,
50
,
and
100
with
m
= 100
,
200
, and
500
Monte Carlo replications.
Plot histograms of the sample means for each distribution and each sample size.
(a) Standard normal,
N
(0
,
1)
(b) Uniform,
U
[0
,
1]
(c) Mixed Normal,
P
[
x
∼
N
(
−
3
,
1)] =
P
[
x
∼
N
(3
,
1)] = 0
.
5
(d) Exponential,
λ
exp (
−
λx
)
(set
λ
= 2
and let
x
∼
U
[0
,
1]
)
(e) Student-
t, t
5
7. This problem is to conduct a Monte Carlo experiment to examine the
fi
nite sample per-
formance of a test in size (
P
(
reject H
0
:
H
0
is true
)
) and power (
P
(
reject H
0
:
H
0
is false
)
).
(a) Size: Generate a random sample
x
1
, x
2
, . . . , x
n
of size
n
= 50
, with
μ
= 0
and
σ
2
= 1
from two distributions, (i) normal and (ii) uniform. Pretend you do not
know the mean and variance. Then test the null hypothesis that
μ
= 0
against
the alternative that it is not equal to zero. Use Monte Carlo experiments with
500
replications to evaluate the size of the test statistic t.
Use the asymptotic
critical value at the 5% level (1.96). Repeat with
n
= 100
and
200
. What do you
fi
nd?
(b) Power: Repeat part (a) with
μ
= 0
.
1
,
0
.
3
,
−
0
.
1
, and
−
0
.
3
. Plot the power function
(include
μ
= 0
in the plot).
1