Extracting the functional form of the likelihood from the function `msm()` in R

by ralph   Last Updated October 20, 2019 00:19 AM - source

Is there a way of extracting the functional form of the likelihood function that gets formed by the msm function in R?

How can I extract the likelihood function that gets formed in the example below?

library(msm)

# look at transition counts
statetable.msm(state, PTNUM, data = cav)

# define transition intensity matrix
# 1's mean a transition can occur
# 0's mean a transition should not occur
# any number can be placed on the diagonal as R overwrites the diagonals 
# prior to maximising
q <- rbind(
  c(0, 1, 0, 1),
  c(1, 0, 1, 1),
  c(0, 1, 0, 1),
  c(0, 0, 0, 0)
  )


# fit msm to the data
# the fnscale rescales the likelihood to prevent overflow
msm.fit <- msm(state ~ years, PTNUM, data = cav, qmatrix = q, control=list(fnscale=4000))

Tags : r likelihood


Related Questions


Understand a statement about likelihood function

Updated January 28, 2019 21:19 PM


What does “likelihood” mean in the image?

Updated June 14, 2017 11:19 AM

Confidence intervals with penalized likelihood

Updated November 20, 2017 11:19 AM

Optimal Neyman Pearson Test and Decision Region

Updated May 26, 2018 13:19 PM