LogLikelihood function from the Time Series package is apparently missing

8

1

The Time Series package for Mathematica comes with a function called LogLikelihood. It is discussed and used extensively in the documentation (pdf). So does Mathematica 8. First I though my inability to use LogLikelihood was that it was being shadowed by the LogLikelihood function in Mathematica itself, but apparently not.

Loading the package with

Needs["TimeSeries`TimeSeries`"]

works for every other function, but the only LogLikelihoodfunction I have access to is Mathematica's built in one. Trying to refere to it with the full context, like so

TimeSeries`TimeSeries`LogLikelihood

doesn't work either. It is as if this one function simply isn't there. I've also tried re-downloading the package and reinstalling in case I got a corrupt version the first time around, but this hasn't helped.

EDIT: The way I am calling the function should be correct:

data = TimeSeries[ARModel[{0.5, -0.2}, 1], 20]
(*{0.775171, -0.0377616, -0.568652, 1.56771, 1.32269, -1.60302, \
-1.53275, 0.127154, 1.37393, 0.138493, -0.0484376, -0.506817, \
0.731963, 2.28373, 0.374458, 0.468365, 2.48781, 1.24375, 1.0746, \
-0.401619}*)

LogLikelihood[data, ARModel[{0.5}, 1]]
(*LogLikelihood[{0.775171, -0.0377616, -0.568652, 1.56771, 
  1.32269, -1.60302, -1.53275, 0.127154, 1.37393, 
  0.138493, -0.0484376, -0.506817, 0.731963, 2.28373, 0.374458, 
  0.468365, 2.48781, 1.24375, 1.0746, -0.401619}, ARModel[{0.5}, 1]]*)

EDIT2: Using full context in calling the function has the same result:

TimeSeries`TimeSeries`LogLikelihood[data, ARModel[{0.5}, 1]]
(*LogLikelihood[{0.775171, -0.0377616, -0.568652, 1.56771, 
  1.32269, -1.60302, -1.53275, 0.127154, 1.37393, 
  0.138493, -0.0484376, -0.506817, 0.731963, 2.28373, 0.374458, 
  0.468365, 2.48781, 1.24375, 1.0746, -0.401619}, ARModel[{0.5}, 1]]*)

EDIT3: This is the context path:

$ContextPath
(*{"TimeSeries`TimeSeries`", "PacletManager`", "WebServices`", \
"System`", "Global`"}*)

Mr Alpha

Posted 2012-05-21T13:44:52.083

Reputation: 3 046

@Szabolcs I was looking for that the other day. Instead, I accidentally removed both Global` and System` from my $ContextPath, and things went a little weird. :) – rcollyer – 2012-05-21T13:54:45.737

Another related discussion

– Leonid Shifrin – 2012-05-21T14:05:30.683

So, trying out those solution it appears that my problem is something else entirely, since when I load the Time Series package it is the package LogLikelihoodfunction that I can't access, even when using the full context in referring to it. – Mr Alpha – 2012-05-21T14:56:31.573

4To those who vote(d) to delete: I think it would make much more sense to keep this as another gateway to the same common problem. – Leonid Shifrin – 2012-05-21T15:06:58.253

3@MrAlpha If you could add your new findings to your question I feel this makes for a completely new situation. The other questions have answers that mostly assume that using the full name should resolve the shadowing problem, which doesn't appear to be the case in your situation. Could you retry this first on a freshly started system, just to be sure? A complication is that Time Series isn't a standard package, so I'm not sure how many of us would be able to duplicate what you found. After updating please flag for moderator attention. – Sjoerd C. de Vries – 2012-05-21T20:27:48.753

In your edit, you're not using the full context call... – Sjoerd C. de Vries – 2012-05-22T14:08:20.757

I don't have this package, so I don't know what it looks like and whether the source code is accessible. But it would be worth a try to search all files in the package for the string LogLikelihood and see what you get. (BTW I'm deleting my now irrelevant first comment.) – Szabolcs – 2012-05-22T14:28:02.533

Two more things to try: is the name TimeSeries`TimeSeries` really on the context path or is it perhaps just TimeSeries`? Could you try an exact example from the documentation, for instance the one on page 80? – Sjoerd C. de Vries – 2012-05-22T14:29:29.920

@Szabolcs I thought about doing that but I don't even know where the files are. The package comes in form of a .exe installer. No install path or anything. – Mr Alpha – 2012-05-22T15:01:02.820

@SjoerdC.deVries I've exactly tried several of the examples from the documents, including the one on page 80. None work. – Mr Alpha – 2012-05-22T15:04:59.037

@MrAlpha My guess is that it's either in $UserBaseDirectory (per user install) or $BaseDirectory (install for all users). (Within the Applications subdir of these, of course.) You can check $InstallationDirectory as well, but I hope it's not there ... it'd get wiped with a resintall ... FindFile will help too, e.g. FindFile["Combinatorica`"] tells me where Combinatorica lives. – Szabolcs – 2012-05-22T15:05:17.603

@Szabolcs Thank you. I found it in the $BaseDirectory. After browsing through the code I also managed to figure out what the problem is. Apparently they've renamed the function, they just haven't bothered to update the documentation. – Mr Alpha – 2012-05-22T15:16:41.940

@MrAlpha If you solved the problem, could you post an answer detailed enough to be useful for anyone else who hits the same problem? (And you can accept the answer.) – Szabolcs – 2012-05-22T15:22:05.523

Answers

7

Wolfram has renamed the LogLikelihood function in the Time Series package to LogLikelihoodFunction. But they have apparently forgotten to update the documentation.

Mr Alpha

Posted 2012-05-21T13:44:52.083

Reputation: 3 046