Skip to content

Commit fc5a302

Browse files
committed
edited README
1 parent 44a6fc3 commit fc5a302

File tree

1 file changed

+23
-24
lines changed

1 file changed

+23
-24
lines changed

README.rst

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,39 +7,18 @@ This project uses rpy2 to expose most of the functionality of R's Forecast packa
77
Some related functions in the stats and base packages are also exposed (e.g. seasonal decompositions).
88
A few less-commnonly used functions and arguments are not exposed.
99

10-
An example of generating a forecast:
11-
12-
.. code-block::
13-
14-
from rforecast import wrappers
15-
from rforecast import ts_io
16-
17-
stock = ts_io.read_series('data/livestock.csv')
18-
fc = wrappers.forecast(stock)
19-
print fc
20-
21-
This example uses the ``livestock`` series in ``data/`` under the installation directory.
22-
23-
An example of generating an STL decomposition:
24-
25-
.. code-block::
26-
27-
aus = ts_io.read_series('aus.csv')
28-
dc = wrappers.stl(aus, s_window=5)
29-
print dc
30-
31-
3210
The rforecast.py package uses Pandas Series objects to represent time series.
3311
For seasonal series, it uses a multindex with the second level of the index
3412
denoting the season. The ``read_series`` function in ``ts_io`` will return a
35-
series with the index constructed correctly.
13+
series with the index constructed correctly, given .csv files like those in the
14+
``/data`` directory.
3615
If the data are already in a Python sequence, such as a list or numpy array,
3716
you can convert it to a series of the right form like this:
3817

3918
.. code-block:: python
4019
4120
from rforecast import converters
42-
# A slice of the 'oil' data from R package fpp, available in data/
21+
# A slice of the 'oil' data from R package fpp, also available in data/
4322
data = [509, 506, 340, 240, 219, 172, 252, 221, 276, 271, 342, 428, 442, 432, 437]
4423
ts = converters.sequence_as_series(data, start=1980)
4524
print ts
@@ -50,6 +29,26 @@ you can convert it to a series of the right form like this:
5029
ts = converters.sequence_as_series(data, start=(1991, 1), freq=4)
5130
print ts
5231
32+
Forecasting and decomposition methods are in the wrappers module:
33+
34+
.. code-block::
35+
36+
from rforecast import wrappers
37+
38+
An example of generating a forecast (using ts above):
39+
40+
.. code-block::
41+
42+
fc = wrappers.forecast(ts)
43+
print fc
44+
45+
An example of generating an STL decomposition :
46+
47+
.. code-block::
48+
49+
dc = wrappers.stl(ts, s_window=5)
50+
print dc
51+
5352
There is more information in the `.rst` files under ``doc/``.
5453
The documentation is built with Sphinx.
5554
If you have Sphinx installed, you can build the documentation using the Makefile

0 commit comments

Comments
 (0)