Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8320137
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T22:33:21+00:00 2026-06-08T22:33:21+00:00

I have a continuous univariate xts object of length 1000, which I have converted

  • 0

I have a continuous univariate xts object of length 1000, which I have converted into a data.frame called x to be used by the package RHmm.

I have already chosen that there are going to be 5 states and 4 gaussian distributions in the mixed distribution.

What I’m after is the expected mean value for the next observation. How do I go about getting that?

So what I have so far is:

  1. a transition matrix from running the HMMFit() function
  2. a set of means and variances for each of the gaussian distributions in the mixture, along with their respective proportions, all of which was also generated form the HMMFit() function
  3. a list of past hidden states relating to the input data when using the output of the HMMFit function and putting it into the viterbi function

How would I go about getting the next hidden state (i.e. the 1001st value) from what I’ve got, and then using it to get the weighted mean from the gaussian distributions.

I think I’m pretty close just not too sure what the next part is…The last state is state 5, do I use the 5th row in the transition matrix somehow to get the next state?

All I’m after is the weighted mean for what is to be expect in the next observation, so the next hidden state isn’t even necessary. Do I multiply the probabilities in row 5 by each of the means, weighted to their proportion for each state? and then sum it all together?

here is the code I used.

# have used 2000 iterations to ensure convergence
a <- HMMFit(x, nStates=5, nMixt=4, dis="MIXTURE", control=list(iter=2000)
v <- viterbi(a,x)
a
v

As always any help would be greatly appreciated!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T22:33:23+00:00Added an answer on June 8, 2026 at 10:33 pm

    Next predicted value uses last hidden state last(v$states) to get probability weights from the transition matrix a$HMM$transMat[last(v$states),] for each state the distribution means a$HMM$distribution$mean are weighted by proportions a$HMM$distribution$proportion, then its all multiplied together and summed. So in the above case it would be as follows:

    sum(a$HMM$transMat[last(v$states),] * .colSums((matrix(unlist(a$HMM$distribution$mean), nrow=4,ncol=5)) * (matrix(unlist(a$HMM$distribution$proportion), nrow=4,ncol=5)), m=4,n=5))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to have a continuous Cell, which is not cropped to the width
I have a table that has two columns both of them are continuous data.
I have a purchase form that has a continuous subform which shows line items
Im using the jQuery SmoothDivScroll plugin. http://www.smoothdivscroll.com/ I want to have continuous scrolling, but
I have a continuous form that works when I manually open it. However when
I have print $str; abcd*%1234$sdfsd..#d The string would always have only one continuous stretch
I am referred to Hudson today. I have heard about continuous integration before, but
I have been optimizing our continuous integration builds, and the remaining bottleneck seems to
We have Xserver-less CentOS system for continuous integration. So no UI. I want to
We are using Teamcity to do continuous integration builds for our website and have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.