Application Center - Maplesoft

App Preview:

Weak and Strong Stationarity

You can switch back to the summary page by clicking here.

Learn about Maple
Download Application


 

Image 

 

 

Weak and Strong Stationarity 

 

The following was implemented in Maple by Marcus Davidsson (2009) davidsson_marcus@hotmail.com 

 

1) Introduction 

 

 

Note that statistics assumes that the variable examined is strong stationary (serial independent).

If the variable is not strong stationary in levels we can induce strong stationarity by either:
1) Taking the first difference (unit root)
2) Removing time trend (trend stationary)
3) Removing serial dependence (i.e. MA components in error term)
 


Note that a week stationary variable is serial dependent which means that it violates the statistical assumption of zero autocovariance.
 

 

 

I think most statistical text books does not do a good job communicating the difference between and weak and strong stationarity. 

 

 

 

1) Strong Stationarity B=0.1 

 

 

restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .1); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .1); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .1); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .1); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .1); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .1); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .1); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .1); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .1); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .1); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .1); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .1); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .1); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .1); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .1); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .1); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .1); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .1); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .1); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .1); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .1); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .1); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .1); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .1); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .1); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .1); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .1); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .1); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .1); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .1); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
 

 

Plot_2d
Plot_2d
 

 

 

 

Weak Stationarity B=0.9 

 

 

restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .9); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .9); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .9); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .9); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .9); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .9); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .9); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .9); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .9); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .9); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .9); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .9); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .9); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .9); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .9); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .9); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .9); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .9); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .9); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .9); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .9); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .9); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .9); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .9); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .9); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .9); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .9); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .9); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .9); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .9); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .9); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .9); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .9); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .9); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .9); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .9); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .9); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .9); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .9); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .9); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .9); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .9); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
restart; -1; randomize(); -1; with(Statistics); -1; `:=`(a, 0); -1; `:=`(b, .9); -1; `:=`(n, 1000); -1; `:=`(r, Sample(RandomVariable(Normal(0, 1)), n)); -1; `:=`(s[1], 0); -1; for i from 2 to n do `:...
 

 

 

 

Plot_2d
Plot_2d
Plot_2d
Plot_2d
 

 

 

 

 

Legal Notice: ? Maplesoft, a division of Waterloo Maple Inc. 2009. Maplesoft and Maple are trademarks of Waterloo Maple Inc. Neither Maplesoft nor the authors are responsible for any errors contained within and are not liable for any damages resulting from the use of this material.  This application is intended for non-commercial, non-profit use only. Contact the authors for permission if you wish to use this application in for-profit activities.