Hidden Markov Model Toolbox for Matlab

Source: Internet
Author: User

Official website: http://www.cs.ubc.ca/~murphyk/Software/HMM/hmm.html

Download

Click here. Unziping creates a directory called Hmmall, which contains 4 subdirectories.

Installation

Assuming unzip it to c:/hmmall ...

>> Addpath (Genpath (' C:/hmmall ')) >> testhmm



Here is a sample code that demonstrates how to fill in an existing probabilistic build model:

  q =  3  #% more countries  ( Sun , rain , fog    
O = 2;% # number of continuous observations ( umbrella ,  no umbrella )

% # Priori probabilities
prior = [1 0 0];
  %# state transition matrix  (1 : Sun , 2 : rain ,3 : fog )        
  a = [0.8  0.05 0.15;0.2 0.6 0.2  0.2 0.30.5;            
  %#< Span class= "PLN" > observation emission matrix  (1 : umbrella , 2 : no  umbrella ),  
B = [0.1 0.9 0.8 0.2 0.3 0.7 .

Then we can taste a bunch of sequences from this model:

NUM =  20 ;  %# 20 序列
  t = 10       < Span class= "pun" >< Span class= "lit" >%# each length 10   ( days    
[seqs,states] = dhmm_sample(prior, A, B, num, T);


http://www.matlabsky.com/thread-120-1-1.html"original" matlab How to install a new toolbox

As for the MATLAB Toolbox installation involves Matlab search path, working directory, current path, user path, and many other terms, I don't want to say anything here

Interested users, you can directly view the MATLAB Help system, where you can get the most direct response, but you need a certain foundation of English OH

There are many ways to add a toolbox, all for the same purpose, to add the path of the toolbox to the search path of MATLAB.

Here's one of the simplest things to do, and here's an example of installing Mathmodl (Mathematical Modeling Toolbox).

A, you need to install the Toolbox to extract into the $matlabroot\toolbox (in fact, any path is possible, but in order to facilitate management, we are generally installed here), $MatlabRoot is your MATLAB installation path, You can enter the Matlabroot command in MATLAB to get

(1) Enter the following in MATLAB (of course you can use the Explorer directly into the Toolbox directory)

    1. >> Matlabroot
    2. Ans =
    3. D:\Program files\matlab\r2008a
    4. >> Winopen (ANS)
Copy Code

(2) This will automatically jump to the installation directory of MATLAB, double-click the Toolbox folder under Open Directory

<ignore_js_op>

(3) Copy the Mathmodl Toolbox into toolbox

<ignore_js_op>

B. Add the path you just mathmodl to the MATLAB search path (you can use the MATLAB command line, but also use the Matlab menu operation, for the sake of simplicity we use the second type)

(1) The following operation in MATLAB, File-->set path...--> Click Add with Subfolders ...

<ignore_js_op>

(2) in the browse file, select the installation path that you just $matlabroot/toolbox/mathmodl, click OK

<ignore_js_op>

(3) Return to the Set Path dialog box, click the Save button in the bottom left corner (remember to save), the Toolbox is completely installed, click the Close dialog box

C. Test the New Installation toolbox is available, enter the following in MATLAB

    1. >>help mathmodl% Enter the toolbox name, which typically returns a description of the toolbox, that is, the contents of CONTENT.M under the Mathmodl path
    2. % is entered below the command line, and all files under the Mathmodl path are returned
    3. >>what Mathmodl
    4. % and then to Mathmodl to find a function that does not have the same name as the MATLAB, such as DYNPROG.M, enter on the command line
    5. >>which Dynprog. M
    6. D:\My Documents\matlab\dynprog. M
Copy Code

D. The toolbox updates the cache, otherwise a warning is given every time MATLAB starts
(1) File-->preferences-->general--> Select Enable Toolbox path cache--> Click Updata Toolbox Path Cache

<ignore_js_op>

(2) Complete the above can close the Preferences dialog box
(3) A toolbox is completely installed at this time
(4) If you start Matlab later warning that toolbox path cache is invalid, then repeat the first step of the master is OK

====================================================================
====================================================================

Of course, if you are familiar with the command of MATLAB, you can directly use the command to install the Toolbox , the method is as follows
(1) Unzip the toolbox to any path, but recommended in Toolbox under Matlabroot
(2) Enter in MATLAB

    1. >>addpath (' Your_toolbox_full_path ')% note must be a folder path
    2. >>savepath
Copy Code

(3) also perform the above test and confirmation work, here is not tired of
(4) Update the search directory, you can use the above interface operation, of course, you can also command line

    1. Rehash Toolboxcache
Copy Code

Hidden Markov Model Toolbox for Matlab

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.