Using TimeSeries.OBeu with OpenCPU

Introduction

This document describes the use of the functions implemented in TimeSeries.OBeu package in OpenCPU environment, after installing OpenCPU and TimeSeries.OBeu package on your OpenCPU server address(/ocpu/test).

How to use functions

 ../library/ {name of the library} /R/ {function}

OpenCPU and TimeSeries.OBeu

ts.analysis

In this example we will use ts.analysis function that returns in a single call a json string or a list with the following components:

ts.analysis components
Component Output Description
acf.parameters
  • acf
  • acf.lag
  • confidence.interval.up
  • confidence.interval.low
  • ACF values of the input time series
  • Lags at which the acf is estimated
  • Upper limit of the confidence interval
  • Lower limit of the confidence interval
pacf.parameters
  • pacf
  • pacf.lag
  • confidence.interval.up
  • confidence.interval.low
  • PACF values of the input time series
  • Lags at which the pacf is estimated
  • Upper limit of the confidence interval
  • Lower limit of the confidence interval
acf.residuals.parameters
  • acf.res
  • acf.res.lag
  • confidence.interval.up
  • confidence.interval.low
  • ACF values of the model residuals
  • Lags at which the acf is estimated of the model residuals
  • Upper limit of the confidence interval
  • Lower limit of the confidence interval
pacf.residuals.parameters
  • pacf.res
  • pacf.res.lag
  • confidence.interval.up
  • confidence.interval.low
  • Pacf values of the model residuals
  • Lags at which the pacf is estimated of the model residuals
  • Upper limit of confidence interval
  • Lower limit of confidence interval
stl.plot
  • trend
  • trend.ci.up
  • trend.ci.low
  • seasonal
  • remainder
  • time
  • Trend component
  • Up limit for trend component
  • Low limit for trend component
  • Seasonal component
  • Remainder component
  • Time of the series was sampled
stl.general
  • stl.degree
  • degfr
  • degfr.fitted
  • fitted
  • Degree of fit
  • Effective degrees of freedom
  • Fitted degrees of freedom
  • Model’s fitted values
residuals
  • residuals
  • Residuals of the model
compare
  • arima.order
  • arima.coef
  • arima.coef.se
  • covariance.coef
  • resid.variance
  • not.used.obs
  • used.obs
  • loglik
  • aic
  • bic
  • gcv
  • aicc
  • Arima order
  • AR, MA and regression coefficients
  • Standard error of the coefficients
  • Variance of the coefficients
  • Residuals variance
  • Number of not used observations
  • Used observations
  • Maximized log-likelihood,
  • AIC value
  • BIC value
  • Generalized cross-validation statistic
  • Second-order AIC
forecasts
  • ts.model
  • data_year
  • data
  • predict_time
  • predict_values
  • up80
  • low80
  • up95
  • low95
  • A string indicating the arima orders
  • Time of time series data
  • Time series values
  • Time of the predicted values
  • Predicted values
  • Upper 80% confidence limit
  • Lower 80% confidence limit
  • Upper 95% confidence limit
  • Lower 95% confidence limit

Select library and function

  1. Go to: yourserver/ocpu/test

  2. Copy and paste the following function to the endpoint

  1. Select Method: Post

Adding parameters parameters

Click add parameters every time you want to add a new parameters and values.

  1. Define the input data:

    • Param Name: tsdata
    • Param Value: e.g. Athens_executed_ts
  2. Define the prediction steps parameter:

    • Param Name: prediction.steps
    • Param Value: 2

You add likewise x.order parameter to fit a specific arima order, see TimeSeries.OBeu reference manual for further details.

  1. Ready! Click on Ajax request!

Results

  1. copy the /ocpu/tmp/{this_id_number}/R/.val (second on the right panel)

  2. finally, paste yourserver/ocpu/tmp/{this_id_number}/R/.val on a new tab.

Further Details

Github