A14Mhttps://www.a14m.uk/2020-06-03T21:20:00+01:00Alistair Marshall's siteShift the Filter2020-06-03T21:20:00+01:002020-06-03T21:20:00+01:00Alistair Marshalltag:www.a14m.uk,2020-06-03:/2020/06/shift-the-filter/<p>I have previously written about filters when talking about signals in control engineering. To avoid reacting to a noisy signal, you take the average over a period of time, to allow the noise to cancel itself out. The resulting trend is smoother and represents the real trend.</p>
<p>I noticed another …</p><p>I have previously written about filters when talking about signals in control engineering. To avoid reacting to a noisy signal, you take the average over a period of time, to allow the noise to cancel itself out. The resulting trend is smoother and represents the real trend.</p>
<p>I noticed another clear example when looking at the COVID-19 deaths <a href="https://www.gov.uk/government/publications/slides-and-datasets-to-accompany-coronavirus-press-conference-3-june">as reported by the UK government</a>.</p>
<div class="perfundo">
<a class="perfundo__link" href="#-images-2020-covid19_deaths_1.png">
<figure class="imgcontainer">
<img src="https://a14m.uk/thumbs/2020/covid19_deaths_1_thumbnail_wide.png" alt="Graph of daily deaths as published by the UK Government">
</figure>
</a>
<div id="-images-2020-covid19_deaths_1.png" class="perfundo__overlay fadeInLeft">
<figure class="perfundo__content perfundo__figure">
<img src="/thumbs/2020/covid19_deaths_1_w800.png" alt="Graph of daily deaths as published by the UK Government">
<div class="perfundo__image" style="width: 800px; padding-top: 56.25%; background-image: url(/thumbs/2020/covid19_deaths_1_w800.png);"></div>
</figure>
<a href="#perfundo-untarget" class="perfundo__close perfundo__control">Close</a>
</div>
</div>
<div style="clear:both;"></div>
<p>The graph shows the number of deaths reported each day as well as a trend of the rolling seven day average. As I mentioned in my previous post, the drawback of using a filter is that it adds a lag to the result and this can be seen in the graph. When the number of deaths is rising sharply at the start, the trend lags behind all the daily figures. Similarly, as the cases have been decreasing, the trend looks worse than the daily figures (though in this case, it is less obvious because the daily figures jump around depending on the day of the week).</p>
<p>There is not much you can do about this lag when trying to control a process. You need to have a value to respond to and you can't look into the future, so you have to accept the lag. However when looking at a trend, you could shift the result. Rather than looking at the average over the last seven days, you take the average of today, the three days on either side. This means that the trend doesn't stop on the last day you have data, but three days earlier.</p>
<p>I have tried to recreate the graph using the government's data below.</p>
<div class="perfundo">
<a class="perfundo__link" href="#-images-2020-covid19_deaths_2.png">
<figure class="imgcontainer">
<img src="https://a14m.uk/thumbs/2020/covid19_deaths_2_thumbnail_wide.png" alt="Graph of daily deaths recreated by myself">
</figure>
</a>
<div id="-images-2020-covid19_deaths_2.png" class="perfundo__overlay fadeInLeft">
<figure class="perfundo__content perfundo__figure">
<img src="/thumbs/2020/covid19_deaths_2_w800.png" alt="Graph of daily deaths recreated by myself">
<div class="perfundo__image" style="width: 800px; padding-top: 56.25%; background-image: url(/thumbs/2020/covid19_deaths_2_w800.png);"></div>
</figure>
<a href="#perfundo-untarget" class="perfundo__close perfundo__control">Close</a>
</div>
</div>
<div style="clear:both;"></div>
<p>This time the trend rises with the daily figures. I believe this shifted figure is better because it also allows you to clearly see when the peak of the cases was. The fact that the line ends short also emphasises that the trend line uses lagged data and is not completely up-to-date.</p>
<p>I like the idea of shifting the filter over so that it reflects the true date that the data refers to. I can also see why using the rolling average as normal is also simpler and why it may be used. I just thought that it was a good example of the lag that is generated by a filter and also asking if there is anything that can be done to overcome it in this case.</p>
<hr>
<p>The original graph and data was obtained from the <a href="https://www.gov.uk/government/publications/slides-and-datasets-to-accompany-coronavirus-press-conference-3-june">Slides and datasets to accompany coronavirus press conference: 3 June</a></p>Test it Tuesday is not Enough2020-05-25T17:54:00+01:002020-05-25T17:54:00+01:00Alistair Marshalltag:www.a14m.uk,2020-05-25:/2020/05/test-it-tuesday-is-not-enough/<p>Fire and rescue services promote the slogan 'Test it Tuesday' as a way to remind people that they should test their smoke alarms every week<sup id=sf-test-it-tuesday-is-not-enough-1-back><a href=#sf-test-it-tuesday-is-not-enough-1 class=simple-footnote title="It looks like this was setup by an alarm manufacturer, but it has been promoted by many of the fire services as well.">1</a></sup>. While most alarms state on them, and in the documentation, that they should be tested every week, most people don't. As a result of …</p><p>Fire and rescue services promote the slogan 'Test it Tuesday' as a way to remind people that they should test their smoke alarms every week<sup id=sf-test-it-tuesday-is-not-enough-1-back><a href=#sf-test-it-tuesday-is-not-enough-1 class=simple-footnote title="It looks like this was setup by an alarm manufacturer, but it has been promoted by many of the fire services as well.">1</a></sup>. While most alarms state on them, and in the documentation, that they should be tested every week, most people don't. As a result of the campaign, I have a weekly recurring task in my todo list to test the alarm. It turns out though that doing a weekly test is not enough.</p>
<p>Several times today, one of our smoke alarms has been getting set off spuriously. Each time I checked and ensured that there was in fact no smoke. Perhaps it was because we had all the windows and doors open. Perhaps it was getting a bit of hayfever. But it was irritating and worrying in equal measure. I looked up the manual and it turns out that as well as doing a weekly test, you are also supposed to clean it every three months with a vacuum cleaner. I had no idea. It has been in place for over seven years now without ever getting vacuumed!</p>
<p>Since getting a clean, it has been running without issue. Looks like I need to add another recurring task to my todo list.</p><ol class=simple-footnotes><li id=sf-test-it-tuesday-is-not-enough-1>It looks like this was setup by an alarm manufacturer, but it has been promoted by many of the fire services as well. <a href=#sf-test-it-tuesday-is-not-enough-1-back class=simple-footnote-back>↩</a></li></ol>Showing Your Support2020-05-21T21:32:00+01:002020-05-21T21:32:00+01:00Alistair Marshalltag:www.a14m.uk,2020-05-21:/2020/05/showing-your-support/<p>In an upset to my normal lockdown routine, I ended up going shopping tonight rather than earlier in the week. As a result, I was halfway around the shop when it was time for the weekly 'Clap for the NHS workers'. While there were a fair number of people clapping …</p><p>In an upset to my normal lockdown routine, I ended up going shopping tonight rather than earlier in the week. As a result, I was halfway around the shop when it was time for the weekly 'Clap for the NHS workers'. While there were a fair number of people clapping around the tills, it was much quieter in the rest of the shop. There was however one person in the aisle next to mine who was trying to make up for everyone else. </p>
<p>This shopper clapped very enthusiastically for the full length of the minute and I couldn't resist. As I made my way down the centre aisle, I had a quick look to see if I could spot our enthusiastic clapper. There was only one person in that aisle so there was no doubt this was our man. I did note that this person was wearing gloves, but not a mask.</p>
<p>At the start of the pandemic, both the UK and Scottish governments recommended against gloves and masks outside of clinical settings. The main fear is that it can give a false sense of security and if handled incorrectly and not washed, can increase the likelihood of spreading the virus. However since then, the evidence has changed and both governments have now updated their advice. Masks are now recommended indoors to help reduce the spread.</p>
<p>So why was our enthusiastic clapper wearing gloves but not a mask? I didn’t talk to him, so I don’t know for certain, but I suspect that part of it is down to not wanting to look like a plonker.</p>
<p>It is one thing to be loud and show support, but hiding your face like a timid wee creature? That is a step too far. We have always associated masks as things to protect us from external things. Wearing a mask makes you look scared. Makes you look like you don’t want to be infected by everyone else. In some ways it makes you look selfish.</p>
<p>But that is not why we should wear a mask. The mask is not there to protect us, it is there to protect everyone else. Perhaps you are one of the lucky ones that is asymptomatic, but could still pass it on. Masks aren’t perfect, but they help. But they will only help if they are widely worn. They will only help if they become normal.</p>
<p>If you want to show your support by clapping, that is all fine and well, but it might also be worth showing your support by following the guidance. All of it. Yes, wearing a mask or a scarf over your face will feel silly at first, but if enough people start to do so, it will feel more silly to be in the minority who doesn’t.</p>
<p>Wearing a mask is not a sign of fear or distrust. It is a sign of compassion and courtesy. Please wear a mask indoors. </p>33.3333333332020-04-20T16:29:00+01:002020-04-20T16:29:00+01:00Alistair Marshalltag:www.a14m.uk,2020-04-20:/2020/04/33333333333/<p>Today I am 33⅓ or 100/3. </p>
<p>My birthday is in the darkest part of December when people are rather busy with some other annual event. As a result, I haven't had a party to celebrate in many years now.</p>
<p>This year, I realised that I turn 33 ⅓, and …</p><p>Today I am 33⅓ or 100/3. </p>
<p>My birthday is in the darkest part of December when people are rather busy with some other annual event. As a result, I haven't had a party to celebrate in many years now.</p>
<p>This year, I realised that I turn 33 ⅓, and this would occur away from the main holiday season. For once, I could actually have a celebration! Well the universe has seemed to conspire against me. First it was the refinery scheduling a shutdown, so I would have been working solid night shifts for the full month. Then, just when I worked out I could get a night off and we could do this, a sub-microscopic menace made me throw out my plans yet again.</p>
<p>I will have my party yet! Instead I will have a virtual boardgame party.</p>