Monday, April 7, 2014

several methods collecting for time series analysis

It is normal for data analysis processing have missing data for reasons. Once the data is missing. It is nature for people ask how the gap on the plot can be "fixed/smoothed". Also, it is very often to be asked to predict next several points ased on previous 7 to 8 points. For example, given history stock level, I am asked to predict stock level for beverage market data analysis.
With the asspumption of whatever has occured in the past will continue to happen in the future, we can treat these questions as time series analysis. Below are list of four methods to do forcecasting for a short time series.

  1. Moving averages
    ma = rollmean(ts, k)
  2. For data without any systematic trend or seasonal components, we can use exponential smoothing
  3. Accounting for data seasonality using Winter's smoothing
  4. Accounting for data trend using Holt's smoothing
  5. install.packages("forecast")
    x = c(1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5 )
    x = ts(x, frequency = 5)
    plot(hw(x, 5), byt = "1")
Below a few collected videos about exponential smoothing and Holt-Winter forecasting method

1.11 Time Series- exponential smoothing

1.12 Time Series- moving averages

Saturday, March 29, 2014

setup android ADT environment on CentOS 6.5 64 bit.

  1. download ADT from
  2. mkdir ~/local/tools/android and copy bundle zip file into and unzip it.
  3. your/adt/unziped/folder/eclipse/eclipse.
  4. Create Hello World app and get error like "Error executing aapt. Please check aapt is present at ~/local/tools/android/adt-bundle-linux-x86_64-20140321/sdk/build-tools/android-4.4.2/aapt appcompat_v7 Unknown Android Packaging Problem" etc.
  5. yum groupinstall "Compatibility libraries"
    yum -y install --skip-broken glibc.i686 arts.i686 audiofile.i686 bzip2-libs.i686 cairo.i686 cyrus-sasl-lib.i686 dbus-libs.i686 directfb.i686 esound-libs.i686 fltk.i686 freeglut.i686 gtk2.i686 hal-libs.i686 imlib.i686 lcms-libs.i686 lesstif.i686 libacl.i686 libao.i686 libattr.i686 libcap.i686 libdrm.i686 libexif.i686 libgnomecanvas.i686 libICE.i686 libieee1284.i686 libsigc++20.i686 libSM.i686 libtool-ltdl.i686 libusb.i686 libwmf.i686 libwmf-lite.i686 libX11.i686 libXau.i686 libXaw.i686 libXcomposite.i686 libXdamage.i686 libXdmcp.i686 libXext.i686 libXfixes.i686 libxkbfile.i686 libxml2.i686 libXmu.i686 libXp.i686 libXpm.i686 libXScrnSaver.i686 libxslt.i686 libXt.i686 libXtst.i686 libXv.i686 libXxf86vm.i686 lzo.i686 mesa-libGL.i686 mesa-libGLU.i686 nas-libs.i686 nss_ldap.i686 cdk.i686 openldap.i686 pam.i686 popt.i686 pulseaudio-libs.i686 sane-backends-libs-gphoto2.i686 sane-backends-libs.i686 SDL.i686 svgalib.i686 unixODBC.i686 zlib.i686 compat-expat1.i686 compat-libstdc++-33.i686 openal-soft.i686 alsa-oss-libs.i686 redhat-lsb.i686 alsa-plugins-pulseaudio.i686 alsa-plugins-oss.i686 alsa-lib.i686 nspluginwrapper.i686 libXv.i686 libXScrnSaver.i686 qt.i686 qt-x11.i686 pulseaudio-libs.i686 pulseaudio-libs-glib2.i686 alsa-plugins-pulseaudio.i686 for Debian or Ubuntu: sudo apt-get install ia32-libs