Hi  

1. From the source code it looks like predict is just a wrapper around decode. 
I see predict only returns the state sequence with largest likelihood while 
decode also returns the actual value of the log likelihood.  

2. I'm no expert on modelling financial data but it sounds like you are mostly 
interested in the price change so using the first derivative (and maybe 2nd and 
higher derivatives) seems reasonable. As I guess the data is noisy you should 
probably compute these using something like SavitzkyGolay filter:

http://wiki.scipy.org/Cookbook/SavitzkyGolay

Then the sign of the value of the first derivate feature in the state 
distribution mean will tell you if the state represent "up" or "down" (apply a 
distance from 0 threshold for "neutral") and the absolute value will give you 
the magnitude.

Regards,  

--  
Helge Reikeras


On Sunday 25 August 2013 at 4:41 PM, Shuo Wang wrote:

> Hi,
>  
> I have two questions regarding the hmm model from a user's perspective,
>  
> 1. what is the difference between method decode and predict, they seems to be 
> having the same description  
>  
> 2. If i fit a financial time series into hmm, hmm seems to automatically 
> detect states based on mean and variance, so if I want it to detect states 
> related to regimes(up, down and neutral trends), I have to transform price 
> into binary time series, such as 1 indicates current minute is a rise compare 
> to previous minutes, -1 indicates current minute is a drop compare to 
> previous minutes, 0 is unchanged. But if I transform my price info into 
> binary information, I loss magnitude information. How can I keep the 
> magnitude information, yet still let the hmm detect up, down and neutral 
> trend, instead of mean and variance regimes.
>  
> --  
> 王硕
> 邮箱:[email protected] (mailto:[email protected])
> Whatever your journey, keep walking.  
> ------------------------------------------------------------------------------
> Introducing Performance Central, a new site from SourceForge and  
> AppDynamics. Performance Central is your source for news, insights,  
> analysis and resources for efficient Application Performance Management.  
> Visit us today!
> http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
>  
> _______________________________________________
> Scikit-learn-general mailing list
> [email protected] 
> (mailto:[email protected])
> https://lists.sourceforge.net/lists/listinfo/scikit-learn-general
>  
>  


------------------------------------------------------------------------------
Introducing Performance Central, a new site from SourceForge and 
AppDynamics. Performance Central is your source for news, insights, 
analysis and resources for efficient Application Performance Management. 
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
_______________________________________________
Scikit-learn-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

Reply via email to