BeginPackage["RecurrencePlots`"] Embed::usage = "Embed[series, d] can be used to embed a time series to arbitraty dimensions \"d\"." FindIndexOfNeighbours::usage="FindIndexOfNeighbours[i,series,r] returns the index number of those elements of \"series\" whose distance is not greater than \"r\" to the element with the index number \"i\"." FindNeighbours::usage="FindNeighbours[i,series,r] returns a 2-dim list with the i'th element of \"series\" and with a list of elements of \"series\" whose distance is not greater than \"r\" to the element with the index number \"i\"." RecurrencePlot::usage="RecurrencePlot[series,r] returns a Recurrence Plot of \"series\" where \"r\" determines the distance and thus the number of points n the plot. Series must first be transformed to appropriate embedding dimension." Begin["`Private`"] Embed[data_,dim_]:=Partition[data,dim,1]; FindIndexOfNeighbours[start_,data_, r_]:= Module[{var, next, neighbourlist={}}, If[ Length[Dimensions[data]]==1, (* then: one dimensionsal *) Do[ If[Abs[data[[start]]-RotateLeft[data, start][[i]]]Length[data]; If[nextLength[data]; If[next150, Print["\nYou've got time to get a coffee now!"]]; plotlist = Table[Map[Point[{i,#}]&, FindIndexOfNeighbours[i,data,r]], {i,2,Length[data]}]; Show[Graphics[{PointSize[0.004],plotlist}],Graphics[Line[{{0,0},{Length[data],Length[data]}}]], AspectRatio->1,Axes->True];] End[] EndPackage[]