Skip to content
Prev 175052 / 398506 Next

Weighting data with normal distribution

I have a vector of binary data ? a string of 0?s and 1?s. 
I want to weight these inputs with a normal kernel centered around entry x
so it is transformed into a new vector of data that takes into account the
values of the entries around it (weighting them more heavily if they are
near).

Example:
      -
   -     -
-          -
0 1 0 0 1 0 0 1 1 1 1 
If x = 3, it?s current value is 0 but it?s new value with the Gaussian
weighting around would be something like .1*0+.5*1+1*0+0.5*0+.1*1= 0.6

I want to be able to play with adjusting the variance to different values as
well.
I?ve found wkde in the mixtools library and think it may be useful but I
have not figured out how to use it yet.

Any tips would be appreciated.

Thanks!