-
Notifications
You must be signed in to change notification settings - Fork 3
/
libs.tests.prg
149 lines (122 loc) · 4.08 KB
/
libs.tests.prg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
subroutine JBTest( )
if !ifVarLar=1 then
%jb=@getnextname("ZZ__stats")
freeze({%jb}) resid.stats
!renk=1
if @val({%jb}(15,2))<!pcrit2 then
!renk=2
endif
call TabloRenkEkle(" Jarque-Bera (Prob): ",{%jb}(14,2) + " ("+ {%jb}(15,2)+")",!renk)
' if !autocor=1 then
' call TabloRenkEkle(" Breusch-Godfrey Serial Correlation LM Test: ","There is problem",2)
' else
' call TabloRenkEkle(" Breusch-Godfrey Serial Correlation LM Test: ","There is No problem",1)
' endif
!testSirasi=!testSirasi+1
{%Diagnostics}.append {%eqname}.hist
{%Diagnostics}.name !testSirasi "Normality"
endif
endsub
subroutine LmTest( scalar !q )
if !ifVarLar=1 then
%autoBG=@getnextname("ZZ__autoBG")
freeze({%autoBG}) {%eqname}.auto(!q)
!renk=1
if @val({%autoBG}(3,5))<!pcrit2 then
!renk=2
endif
%lmyaz="Breusch-Godfrey Serial Correlation LM("+@str(!q)+") F(Prob): "
%lmicYaz={%autoBG}(3,2) + " ("+ {%autoBG}(3,5)+")"
call TabloRenkEkle(%lmyaz,%lmicYaz,!renk)
{%Diagnostics}.append {%autoBG} '%bu
!testSirasi=!testSirasi+1
%adi="Auto_correlation_"+@str(!q)
{%Diagnostics}.name !testSirasi {%adi}
endif
endsub
subroutine ResetTest( scalar !q )
if !ifVarLar=1 then
' sadece q=1 olduğunda 8. satira kayiyor
' !satirno=7
' if !q=1 then
' !satirno=8
' endif
!satirno=1
%ResetTest=@getnextname("ZZ__ResetTest")
freeze({%ResetTest}) {%eqname}.reset(!q)
while @wfindnc({%ResetTest}(!satirno,1),"F-statistic")<>1
!satirno=1+!satirno
wend
!renk=1
if @val({%ResetTest}(!satirno,4))<!pcrit2 then
!renk=2
endif
%lmyaz="Ramsey RESET Test("+@str(!q)+") F(Prob): "
%lmicYaz={%ResetTest}(!satirno,2) + " ("+ {%ResetTest}(!satirno,4)+")"
call TabloRenkEkle(%lmyaz,%lmicYaz,!renk)
{%Diagnostics}.append {%ResetTest} '%bu
!testSirasi=!testSirasi+1
%adi="Ramsey_RESET_"+@str(!q)
{%Diagnostics}.name !testSirasi {%adi}
endif
endsub
subroutine HETR_BPG()
if !ifVarLar=1 then
%hettest=@getnextname("ZZ__hettest")
freeze({%hettest}) {%eqname}.hettest(type=BPG) @REGS
!renk=1
if @val({%hettest}(3,5))<!pcrit2 then
!renk=2
endif
call TabloRenkEkle("Heteroskedasticity Breusch-Pagan-Godfrey F(Prob): ",{%hettest}(3,2) + " ("+ {%hettest}(3,5)+")",!renk)
{%Diagnostics}.append {%hettest} '%bu
!testSirasi=!testSirasi+1
{%Diagnostics}.name !testSirasi "BPG_Heteroskedasticity"
endif
endsub
subroutine HETR_WHITE()
if !ifVarLar=1 then
%hettest=@getnextname("ZZ__hettest")
freeze({%hettest}) {%eqname}.hettest(c,type=White) @white(@comp)
!renk=1
if @val({%hettest}(3,5))<!pcrit2 then
!renk=2
endif
call TabloRenkEkle("Heteroskedasticity White F(Prob): ",{%hettest}(3,2) + " ("+ {%hettest}(3,5)+")",!renk)
{%Diagnostics}.append {%hettest} '%bu
!testSirasi=!testSirasi+1
{%Diagnostics}.name !testSirasi "White_Heteroskedasticity"
endif
endsub
'the null hypothesis that there is no ARCH
subroutine HETR_ARCH(scalar !q )
if !ifVarLar=1 then
%hettest=@getnextname("ZZ__hettest")
freeze({%hettest}) {%eqname}.hettest(lags =!q,type=Arch) @REGS
!renk=1
if @val({%hettest}(3,5))<!pcrit2 then
!renk=2
endif
call TabloRenkEkle("Heteroskedasticity ARCH("+@str(!q) +") F(Prob): ",{%hettest}(3,2) + " ("+ {%hettest}(3,5)+")",!renk)
{%Diagnostics}.append {%hettest} '%bu
!testSirasi=!testSirasi+1
%adi= "ARCH"+@str(!q) +"_Heteros"
{%Diagnostics}.name !testSirasi {%adi}
endif
endsub
'null hypothesis of no heteroskedasticity against heteroskedasticity
subroutine HETR_Harvey()
if !ifVarLar=1 then
%hettest=@getnextname("ZZ__hettest")
freeze({%hettest}) {%eqname}.hettest(type=Harvey) @REGS
!renk=1
if @val({%hettest}(3,5))<!pcrit2 then
!renk=2
endif
call TabloRenkEkle("Heteroskedasticity Harvey F(Prob): ",{%hettest}(3,2) + " ("+ {%hettest}(3,5)+")",!renk)
{%Diagnostics}.append {%hettest} '%bu
!testSirasi=!testSirasi+1
%adi= "Harvey_Heteros"
{%Diagnostics}.name !testSirasi {%adi}
endif
endsub