Friday 26 February 2016

Excel add-ins

I've finally got back to updating these and putting them on the website. I'm currently working on the time series one and hope to have that done soon.

In the meantime, I have updated the page for the text add-in to give a better idea of what is in it.

ssci.js version 1.2.2

I've updated to version 1.2.2.

The changes are:

  • change the ssci.smooth.filter() function to allow asymmetric filters;
  • add the ability to create symmetric henderson filters.

Wednesday 24 February 2016

ssci.js is on GitHub


I put the ssci.js library on GitHub a while ago but forgot to say anything.

Anyway it’s here should you wish to take a look.

I’ll be using it in more entries (on my wordpress blog) to highlight what it can do.

ssci.js version 1.2.1

I’ve updated the JavaScript library to version 1.2.1. The only changes from v1.2.0 is the addition of a gain function and phase shift function for the filter smoothing function.

Change to Kernel Smoother

Introduction

I recently changed a whole load of the functions in the ssci JavaScript library. One of these changes was the way that the kernel smoothing function worked.

The previous function was fairly slow and didn’t scale particularly well. In fact, the main loop of the function would suggest that it scales as O(n^2).

I therefore decided to make a change to the function. Instead of looping over every point and then calculating the weight at every other point, I’ve changed it so that:
  • It loops through every point similarly to the previous function
  • Then for point n it calculates the weight at the central point (i.e. point n)
  • It then loops through every point lower (in the array) than n and calculates the weight. If the weight of this point is lower than a certain threshold to the central point, then the loop ends.
  • It then loops through every point higher (in the array) than n and calculates the weight. If the weight of this point is lower than a certain threshold to the central point, then the loop ends.

The default setting of the threshold is 0.001 (i.e. 0.1%). The way the function operates though does mean two assumptions have been made.
  • The data has already been ordered in the x-coordinate within the array.
  • The kernel function being used must always decrease from the central point beyond this threshold.
The rest of this entry can be read on my new blog...

Tuesday 23 February 2016

SurveyScience JavaScript Library


I’ve been converting some of the functions from the Excel add-in to Javascript functions within a library. It’s finally ready for release and can be found here.

It contains functions to:
  • Smooth data
  • Deseasonalise data
  • Perform least squares regression
  • Exponential smoothing
  • Create auto-correlation and partial auto-correlation plots
  • Market research functions
  • Utility functions to modify arrays

There’s still some work to do on it but it can be used as is – go to the above link for more details.

I originally started it to created some smoothed lines for some D3 charts.

Hopefully it will prove useful.

Website refreshed

In the process of reprogramming the Excel add-in, I’ve also refreshed my website.
Everything bar the articles have been changed, I think.
I’ve also released a JavaScript version of some of the functions in the add-in. I’ll post about it fully later on but if you want to take a look go here.