obtain a longest non-missing subsequence - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Statistics : Time Series Analysis Package : TimeSeriesAnalysis/LongestDefinedSubsequence

TimeSeriesAnalysis[LongestDefinedSubsequence] - obtain a longest non-missing subsequence

Calling Sequence

LongestDefinedSubsequence(TS)

Parameters

TS

-

TimeSeries object

Description

• 

The LongestDefinedSubsequence command takes a time series and returns a longest contiguous subsequence of data where none of the data sets have missing values. For example, if TS is a TimeSeries object containing the following data:

Matrix5.,3.,2.,2.,Floatundefined,4.,Floatundefined,5.,1.,6.,2.,6.,4.,4.,4.,1.,3.,2.

then the 4th through 6th row of data will be returned. The value Floatundefined is used to represent missing data. (Data for time series is converted to floating point data, so any input of type undefined is converted to Floatundefined and subsequently considered missing.)

• 

If there are multiple longest subsequences (of equal length), then LongestDefinedSubsequence returns an arbitrary one.

Examples

withTimeSeriesAnalysis:

Consider the time series described above.

ts:=TimeSeriesMatrix5.,3.,2.,2.,Floatundefined,4.,Floatundefined,5.,1.,6.,2.,6.,4.,4.,4.,1.,3.,2.,headers=A,B,C,frequency=annual

ts:=Time seriesA, B, C6 rows of data:2009 - 2014

(1)

GetDatats

5.3.2.2.HFloatundefined4.HFloatundefined5.1.6.2.6.4.4.4.1.3.2.

(2)

ldts:=LongestDefinedSubsequencets

ldts:=Time seriesA, B, C3 rows of data:2012 - 2014

(3)

GetDataldts

6.2.6.4.4.4.1.3.2.

(4)

A second example.

ts2:=TimeSeries2.1,undefined,2.5,2.4,undefined,undefined,3.2,2.4

ts2:=Time seriesdata set8 rows of data:2007 - 2014

(5)

ldts2:=LongestDefinedSubsequencets2

ldts2:=Time seriesdata set2 rows of data:2009 - 2010

(6)

GetDataldts2

2.500000000000002.40000000000000

(7)

See Also

TimeSeries


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam