//
//tmtrend command. 
//
//This command is used for fitting unsteady wave using spline curve.
//

//Syntax 
tmtrend wave/
(options)
;

//Options
dim=nn       //nn is number of degree(defalut 5) fittig spline curve. More higher is more overfitting.
predict=xx   //xx is period of spline curve prediction

//Example 
get stockdata.csv@;
plot line data1;

if(# > 229) delrec //This wave has 250 steps,and 229 steps are trainning step. put train; //use tmtrend command for fitting 229 step and predicting 21 step using 4 degree spline. get train; tmtrend data1/ dim=4 period=21 ; anaput traintrend; get traintrend; plot line data1 data1_T dataTC; //data1 is original wave; //data1_T is the spline curve fitting orignal wave; //dataTC is different value meaning data1 - data_T.