title: Scatter plot kernel smoothing: ksmooth() does not smooth my data at all
body: <h2>Original question</h2>
  <p>I want to smooth my explanatory variable, something like Speed data of a vehicle, and then use this smoothed values. I searched a lot, and find nothing that directly is my answer.</p>
  <p>I know how to calculate the kernel density estimation (<code>density()</code> or <code>KernSmooth::bkde()</code>) but I don't know then how to calculate the smoothed values of speed.</p>
  <hr />
  <h2>Re-edited question</h2>
  <p>Thanks to @ZheyuanLi, I am able to better explain what I have and what I want to do. So I have re-edited my question as below.</p>
  <p>I have some speed measurement of a vehicle during a time, stored as a data frame <code>vehicle</code>:</p>
  <pre><code>         t       speed
  1        0   0.0000000
  2        1   0.0000000
  3        2   0.0000000
  4        3   0.0000000
  5        4   0.0000000
  .        .           .
  .        .           .
  1031  1030   4.8772222
  1032  1031   4.4525000
  1033  1032   3.2261111
  1034  1033   1.8011111
  1035  1034   0.2997222
  1036  1035   0.2997222
  </code></pre>
  <p>Here is a scatter plot:</p>
  <p><a href="https://i.stack.imgur.com/b8DMf.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/b8DMf.jpg" alt="scatter" /></a></p>
  <p>I want to smooth <code>speed</code> against <code>t</code>, and I want to use kernel smoothing for this purpose. According to @Zheyuan's advice, I should use <code>ksmooth()</code>:</p>
  <pre><code>fit &lt;- ksmooth(vehicle$t, vehicle$speed)
  </code></pre>
  <p>However, I found that the smoothed values are exactly the same as my original data:</p>
  <pre><code>sum(abs(fit$y - vehicle$speed))  # 0
  </code></pre>
  <p>Why is this happening? Thanks!</p>