Problem with Hpfilter
Fenia <[email protected]> Thu, 2 Nov 2023 14:33:11 +0200
| Newsgroups | gmane.comp.gnu.octave.general |
|---|---|
| Message-ID | <CAO31n7cxcw2tJcPtjyDeH1cwEzUd66q+_U_kof2+zt75yGYDyQ@mail.gmail.com> |
--===============0518445111087796447==
Content-Type: multipart/alternative; boundary="000000000000e2aac506092a97b4"
--000000000000e2aac506092a97b4
Content-Type: text/plain; charset="UTF-8"
Good afternoon,
I will send you the code I wrote so you could please explain to me how to
fix my problem.
When running it, there's an error near line 5 as 'hpfilter' is undefined.
How do I define it, what changes should I make?
Thank you for your time,
Fenia
clear all
danish_data=[ 98.765, 100.246, 98.590; 99.437, 99.740, 99.910; 101.014,
99.925, 101.308; 100.786, 100.089, 100.192; 101.006, 99.016, 98.681;
102.018, 100.497, 102.087;100.750, 100.185, 100.105; 101.573, 100.086,
100.681; 101.502, 100.259, 103.742; 101.579, 100.596, 103.449; 101.674,
100.421, 103.933; 101.510, 100.907, 105.421; 102.082, 100.227, 104.767;
102.158, 100.570, 104.748; 102.805, 100.772, 110.400; 103.012, 101.196,
108.012; 103.273, 100.869, 109.404; 103.198, 101.620, 108.669; 104.925,
102.412, 109.736; 105.302, 102.991, 113.432]
log_danish_data = log(danish_data);
theta=1600;
[trend,cycle]=hpfilter(log_danish_data,theta);
figure(1)
subplot(2,1,1)
plot(1:106, log_danish_data(:,1),1:106, trend(:,1));
title('GDP')
hold on
grid on
subplot(2,1,2)
plot(1:106, cycle(:,1));
title('cycle')
hold on
grid on
--000000000000e2aac506092a97b4
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">Good afternoon,<div>I will send you the code I wrote so yo=
u could please explain to me how to fix my=C2=A0problem.</div><div>When run=
ning it, there's an error near line 5 as 'hpfilter' is undefine=
d. How do I define it, what changes should I make?</div><div>Thank you for =
your time,</div><div>Fenia</div><div><br></div><div>clear all<br>danish_dat=
a=3D[ 98.765, 100.246, 98.590; 99.437, 99.740, 99.910; 101.014, 99.925, 101=
.308; 100.786, 100.089, 100.192; 101.006, 99.016, 98.681; 102.018, 100.497,=
102.087;100.750, 100.185, 100.105; 101.573, 100.086, 100.681; 101.502, 100=
.259, 103.742; 101.579, 100.596, 103.449; 101.674, 100.421, 103.933; 101.51=
0, 100.907, 105.421; 102.082, 100.227, 104.767; 102.158, 100.570, 104.748; =
102.805, 100.772, 110.400; 103.012, 101.196, 108.012; 103.273, 100.869, 109=
.404; 103.198, 101.620, 108.669; 104.925, 102.412, 109.736; 105.302, 102.99=
1, 113.432]<br>log_danish_data =3D log(danish_data);<br>theta=3D1600;<br>[t=
rend,cycle]=3Dhpfilter(log_danish_data,theta);<br>figure(1)<br>subplot(2,1,=
1)<br>plot(1:106, log_danish_data(:,1),1:106, trend(:,1));<br>title('GD=
P')<br>hold on<br>grid on<br>subplot(2,1,2)<br>plot(1:106, cycle(:,1));=
<br>title('cycle')<br>hold on<br>grid on<br></div></div>
--000000000000e2aac506092a97b4--
--===============0518445111087796447==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline
Ci0tLS0tLS0tLS0KV2UgYXJlIHRyYW5zaXRpb25pbmcgdG8gYSB3ZWIgYmFzZWQgZm9ydW0KZm9y
IGNvbW11bml0eSBoZWxwIGRpc2N1c3Npb25zIGF0Cmh0dHBzOi8vb2N0YXZlLmRpc2NvdXJzZS5n
cm91cC9jL2hlbHAK
--===============0518445111087796447==--