File: KFgui_sample.inp

package info (click to toggle)
gretl 2022c-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 59,552 kB
  • sloc: ansic: 409,074; sh: 4,449; makefile: 3,222; cpp: 2,777; xml: 599; perl: 364
file content (30 lines) | stat: -rw-r--r-- 561 bytes parent folder | download | duplicates (4)
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
clear
set verbose off
include KFgui.gfn

set seed 280921

nulldata 256
setobs 1 1 --special

# example 1: random walk plus noise
COMPARE = 0

series m = cum(normal() * 0.25)
series y = m + normal()
Z = {1}
T = {1}
do_smooth = 1
paramtype = 2
b = KFgui(y, Z, T, 1, paramtype, 1, do_smooth)
series mhat = b.state
gnuplot m mhat --time-series --with-lines --output=display

if COMPARE
    # compare with StrucTiSM
    include StrucTiSM.gfn
    mod = STSM_setup(y, 1, 1, 0)
    STSM_estimate(&mod)
    list C = STSM_components(mod)
    ols mhat const y_level
endif