difference equations - Are there different Method options that can be used with FindSequenceFunction?
The help page states that Method
is an option to use with FindSequenceFunction
, but I don't find any further information. (There is also a FunctionSpace option--for which I know that "Polynomial"
is one possibility. But the full list is not easy, it seems, to locate. I presume that if a FunctionSpace
option is not specified, all possibilities are explored.)
Answer
This is not a complete answer. It is a long comment about what I found when I looked at the inspectable source code of this function using various spelunking tools (e.g.. Spelunking package, GeneralUtilities`PrinteDefinitions
, etc.).
Method
parsing looks unusual
First, I wonder if parsing for the Method
option is buggy. First it does this internally:
$UserMethod = Method /. Flatten[{opts}] /. Options[FindSequenceFunction];
Then the whole function has a condition (/;
) on evaluation which includes this:
($UserMethod===Automatic||OptionQ[$UserMethod])
To translate what this means: the only accepted Method
specifications are Method -> Automatic
or something of the form Method -> (opt -> value)
. This double Rule
construct could be what was meant, but is definitely suspect.
Further evidence:
FindSequenceFunction[{1, 1, 2, 3, 5, 8, 13}, n, Method -> "foo"]
(* FindSequenceFunction[{1, 1, 2, 3, 5, 8, 13}, n, Method -> "foo"] *)
FindSequenceFunction[{1, 1, 2, 3, 5, 8, 13}, n, Method -> (foo -> "foo")]
(* Fibonacci[n] *)
I wasn't able to dig deep enough to discover concrete accepted values for Method
Values for FunctionSpace
Automatic
and All
are equivalent, I think.
Other than these, try any of the following or a list of them:
"PeriodicSequence"
"Polynomial"
"RationalFunction"
"HypergeometricTerm"
"ConstantRecursive"
"HolonomicSequence"
"QHolonomicSequence"
Values for TransformationFunctions
A list of some of these:
"Ratio", "Difference", "BinomialTransform",
"BinomialInverseTransform", "BoustrophedonTransform",
"BoustrophedonInverseTransform", "StirlingTransform",
"StirlingInverseTransform", "MoebiusTransform",
"MoebiusInverseTransform", "Convolution", "ExponentialConvolution"
You can also use All
, which means all of them, or Automatic
, which means {"Ratio", "Difference"}
.
Warning: All this information is obtained by looking naively at the implementation. These are just option values which I think are valid. I am not certain, I may have made a mistake. I don't know what the effect of these values are. Since they are undocumented, I don't know if they are meant to be used at all. Some may be experimental or unimplemented. Don't be surprised if Mathematica does unexpected things when you use them.
Comments
Post a Comment