java-timeseries icon indicating copy to clipboard operation
java-timeseries copied to clipboard

Here is how to use this library - Quickstart Tutorial

Open osmankhalid2005 opened this issue 4 years ago • 0 comments

  1. Download the latest version of eclipse for java.
  2. Download the zip file of project, unzip, import in eclipse as gradle project. It will download many jar files, and after the process finishes, there will be approx 25 errors. To fix those errors follow the next step.
  3. Download the library lombok.jar from the URL: https://projectlombok.org/download and place it in the eclipse folder.
  4. Go to command, navigate to the eclipse directory, and give the following command: Drive:\eclipse>java -jar lombok-x.xx.jar (mention exact name of lombok jar file)
  5. Click on install/update button. Exit.
  6. Exit and Restart eclipse.
  7. Select the project folder and click on clean. This will rebuild the project and errors will be gone.
  8. To use the library, create a new java project in eclipse, and go the java build path of project, and select the tab "Projects". Click on add, and select the three existing projects: The project of this library, the project with name "math" and the project with name "time-series"
  9. To test the new project, create a new java class with Main function and use the following code in it:

`package testProj;

import com.github.signaflo.timeseries.TestData; import com.github.signaflo.timeseries.TimeSeries; import com.github.signaflo.timeseries.forecast.Forecast; import com.github.signaflo.timeseries.model.Model; import com.github.signaflo.timeseries.model.arima.Arima; import com.github.signaflo.timeseries.model.arima.ArimaOrder;

public class MainFile {

public static void main(String[] args) 
{
	// TODO Auto-generated method stub
	
			TimeSeries timeSeries = TestData.debitcards;
			ArimaOrder modelOrder = ArimaOrder.order(0, 1, 1, 0, 1, 1); // Note that intercept fitting will automatically be turned off
			Arima model = Arima.model(timeSeries, modelOrder);
			Forecast forecast = model.forecast(1); // To specify the alpha significance level, add it as a second argument.
			
			System.out.println(forecast);
			
			System.out.println(forecast.pointEstimates().mean());

}

} `

osmankhalid2005 avatar Apr 01 '20 12:04 osmankhalid2005