Ask Your Question
1

tseriesChaos package for R from Sage Notebook

asked 2011-05-25 13:12:51 +0100

v_2e gravatar image

updated 2011-05-25 15:02:43 +0100

Kelvin Li gravatar image

Hello! I need some nonlinear time series analysis functionality, which, as I've learnt from Internet, is provided by the 'tseriesChaos' package for R. I tried to use it from inside the Sage Notebook (one of the public servers) like this:

r.library('tseriesChaos')

and got the following error message:

Traceback (click to the left of this block for traceback)
...
  there is no package called 'tseriesChaos'

This variant:

%r
library(tseriesChaos)

gave almost the same:

Error in library(tseriesChaos) : 
  there is no package called 'tseriesChaos'

So it looks like there is no 'tseriesChaos' package in a default Sage installation. So, how is it possible to use it? And how is it probable for the 'tseriesChaos' package to be included into Sage by default?

Thanks.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2011-06-01 05:18:00 +0100

Joaquim Puig gravatar image

First of all you have to install the package tseriesChaos, which is a R package and not a regular Sage package.

As far as I know, to install R packages you need to have compiled version of sage. You go to Sage website, download source, follow the instructions, wait for a while (depending on your hardware) and that's all. Then type:

sage: r.install_packages('tseriesChaos')

and the package will install downloading and compiling packages automatically. The final message will be

Please restart Sage in order to use 'tseriesChaos'.

so restart Sage. After that load the library

sage: r.library('tseriesChaos')

and it should load without problems.

In my opinion, if you just want to use the 'tseriesChaos' package it might be easier to use R directly. With the steps above you, after doing "sage -R" from the shell you can do the following example from tseriesChaos package:

annaquim@aljibe:~$ sage -R

> require(tseriesChaos)
Loading required package: tseriesChaos
Loading required package: odesolve
> output <-lyap_k(lorenz.ts, m=3, d=2, s=200, t=40, ref=1700, k=2, eps=4)
Finding nearests
Keeping  1700  reference points
Following points
> plot(output)
> lyap(output, 0.73, 2.47)
(Intercept)      lambda 
  0.1185032   0.7123131

You can also consider reprogramming the routines using sage or the included numpy/scipy.

edit flag offensive delete link more

Comments

I have now noticed that after version 4.7.1 (maybe before) it is not necessary to recompile SAGE.

Joaquim Puig gravatar imageJoaquim Puig ( 2011-09-13 05:45:57 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2011-05-25 13:12:51 +0100

Seen: 1,087 times

Last updated: Jun 01 '11