<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>teuder</author_name>
  <author_url>https://blog.hatena.ne.jp/teuder/</author_url>
  <blog_title>nonsense days</blog_title>
  <blog_url>https://teuder.hatenablog.com/</blog_url>
  <categories>
    <anon>Rcpp</anon>
  </categories>
  <description>一年ぶりの更新ですね…。 不等間隔の時系列データに対して一定のwindow幅で移動平均や移動分散などを計算したいが、Rでは時間がかかる。という相談が slack の r-wakalang にありました。 推測ですが、Rで普通に（?）やるとwindowの範囲に入っている値を検索するのに、毎回全てのデータから検索してしまうところがボトルネックになっていると思います。そこでRcppを使って値の検索の部分を効率化してみました。 今回は移動平均を計算していますが、紹介する関数を雛形にすれば、windowに対して様々な処理を適用できるはずです。 まずはデータを準備します。 # windowの始点 from…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fteuder.hatenablog.com%2Fentry%2F2017%2F06%2F04%2F144337&quot; title=&quot;Rcppで不等間隔の時系列データに対して移動平均を計算する - nonsense days&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2017-06-04 14:43:37</published>
  <title>Rcppで不等間隔の時系列データに対して移動平均を計算する</title>
  <type>rich</type>
  <url>https://teuder.hatenablog.com/entry/2017/06/04/144337</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
