Find curve pattern of simple time series I have time series data of credit card transaction volumes for different companies. For example:
week1: \$5000
week2: \$6000
week3: \$6200
week4: \$7000
week5: \$9000
...

Is there a simple method in R to determine if the number series has a linear trend upwards, downwards or like a normal distribution (rising first then dropping)?
 A: You should first try and remove any seasonal effects from your data, otherwise the trend might be misleading, especially if your data include transcations from several years. For processing and plotting, the R package stl should be a good point to start: http://stat.ethz.ch/R-manual/R-devel/library/stats/html/stl.html
For general time series analysis issues, you should also see what CRAN has to suggest: http://cran.r-project.org/web/views/TimeSeries.html
A: You should studiously avoid any attempt to deseasonalize or to detrend as eventually that structure potentially has to be re-inserted at the end in order to make forecasts in the observational space. It is a good idea to form a useful equation that incorporates 1) weekly factors 2) holiday effects 3) trends 4) level shifts 5) changes in parameters over time and/or 6) changs in error variance over time without any unwarranted transformations.
A: Sure, This is possible with some programming effort. I work with transaction data a lot. There are two approaches that i have used. Unfortunately there is no standard procedures that is available.
Approach 1 (Pattern known a priori):
If you interested in finding a priori pattern like trend up trend down, then you could use a similarity analysis or a classification problem, click here for an example implementation in SAS with Proc Similarity. There are 6 types of pattern that you can notice in the transnational data sets and I have used in the past:


*

*Increasing trend 

*Decreasing trend

*Level Shift up

*Level shift down

*Spike Up or Down

*no pattern


You could also use neural network to train the 6 patterns and then apply the trained network to your transnational data. See below for these patterns.
Approach 2 (Pattern not known a priori)
If you do not have a priori pattern, then you would want to use AI techniques based on clustering such as neural networks, kohonen networks etc. to let the method automatically find and cluster similar patterns such as trend increase/down etc.
Based on my experience, approach 1 is better than approach 2. If you are intrested in a worked out example, I can post a link to a paper.
Hope this is helpful.
