We can continue to do such experiments for verifying the model (here are the functions). If we could not observe inconsistent results after a long test, we would be lucky enough and agree to accept it as a "standard model". It does be the process of science. Once we find an inconsistent result, we immediately realize that the model should be modified. The error of a good model should be very tiny, yet we have probably not touched its underlying foundation. Science is to look for outliers, and you can almost find. Science is to exceed supposed presuppositions, i.e. absolute time-space and symmetry. Whatever, we have got to understand the פ algorithm, and by the way recommend the IIR algorithm as a substitute for common used methods for general outlier detection. 

## 5. Longest K –Turn Subsequence

In this section, we present a simple visual model for pattern "curve" to meet the requirement of RDD algorithm. Outlier problem of time series data can be described as following.

## Problem 2:

 Given a sequence S of length N, {d1, d2*, … d*N }, which matches pattern "curve", find outliers.

An example is shown in Fig. 3.

As any curve can be expressed by several ordered sets hinged by several common points, we develop a dynamic programming algorithm to detect the order of curve type data, which can be traced to the longest increasing subsequence problem (Schensted, 1961). We first give definition to "turn", and then propose the algorithm.

Definition 5: Given a curve, except for boundary points, each extremum point is called a "turn point"; the number of extremum points is called turns. We denote maximum point by sign "+", 
and minimum point by sign " - ". If a sequence S has t turns and the 1st one is a maximum/minimum points, then it is denoted by [+/-, t ]. [+, 0 ] denotes strictly increasing sequence, [-, 0 ] denotes strictly decreasing sequence.

We then introduce longest k-turn subsequence problem followed by the algorithm.

Problem 3: Given a time series data S of length N, {d0, d1, …, dN-1 }, with T turns, searching a longest subsequence having T turns by passing the first point p0 (0, d0).