Re: Problem with Hpfilter

Ian McCallion <[email protected]> Thu, 2 Nov 2023 13:21:41 +0000
Newsgroups gmane.comp.gnu.octave.general
Message-ID <CAFgLC_EAZ2-7CD84PXgb=QwFTNc516aA9otFW+GWJdc0sTyRQQ@mail.gmail.com>
--===============8146751783342761351==
Content-Type: multipart/alternative; boundary="000000000000c64b8d06092b4423"

--000000000000c64b8d06092b4423
Content-Type: text/plain; charset="UTF-8"

Hpfilter is not yet in octave.

You could try https://ideas.repec.org/c/dge/qmrbcd/1.html but it is
entirely your responsibility to confirm it works under octave and does what
you want.

Hope this helps.

Cheers Ian

On Thursday, 2 November 2023, Fenia <[email protected]> wrote:

> 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
>

--000000000000c64b8d06092b4423
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hpfilter is not yet in octave.<div><br></div><div>You could try=C2=A0<a hre=
f=3D"https://ideas.repec.org/c/dge/qmrbcd/1.html">https://ideas.repec.org/c=
/dge/qmrbcd/1.html</a> but it is entirely your responsibility to confirm it=
 works under octave and does what you want.</div><div><br></div><div>Hope t=
his helps.</div><div><br></div><div>Cheers Ian=C2=A0<br><br>On Thursday, 2 =
November 2023, Fenia &lt;<a href=3D"mailto:[email protected]">zogr=
[email protected]</a>&gt; wrote:<br><blockquote class=3D"gmail_quote" =
style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><di=
v dir=3D"ltr">Good afternoon,<div>I will send you the code I wrote so you c=
ould please explain to me how to fix my=C2=A0problem.</div><div>When runnin=
g it, there&#39;s an error near line 5 as &#39;hpfilter&#39; is undefined. =
How do I define it, what changes should I make?</div><div>Thank you for you=
r time,</div><div>Fenia</div><div><br></div><div>clear all<br>danish_data=
=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.510=
, 100.907, 105.421; 102.082, 100.227, 104.767; 102.158, 100.570, 104.748; 1=
02.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]<br>log_danish_data =3D log(danish_data);<br>theta=3D1600;<br>[tr=
end,cycle]=3Dhpfilter(log_<wbr>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(&#3=
9;GDP&#39;)<br>hold on<br>grid on<br>subplot(2,1,2)<br>plot(1:106, cycle(:,=
1));<br>title(&#39;cycle&#39;)<br>hold on<br>grid on<br></div></div>
</blockquote></div>

--000000000000c64b8d06092b4423--


--===============8146751783342761351==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline

Ci0tLS0tLS0tLS0KV2UgYXJlIHRyYW5zaXRpb25pbmcgdG8gYSB3ZWIgYmFzZWQgZm9ydW0KZm9y
IGNvbW11bml0eSBoZWxwIGRpc2N1c3Npb25zIGF0Cmh0dHBzOi8vb2N0YXZlLmRpc2NvdXJzZS5n
cm91cC9jL2hlbHAK

--===============8146751783342761351==--