Hi,
I have installed the latest markovchain package but I cannot get the following code to run:
weatherStates <- c("sunny", "cloudy", "rain")
byRow <- TRUE
weatherMatrix <- matrix(data = c(0.70, 0.2, 0.1,
0.3, 0.4, 0.3,
0.2, 0.45, 0.35), byrow = byRow, nrow = 3,
dimnames = list(weatherStates, weatherStates))
mcWeather <- new("markovchain", states = weatherStates, byrow = byRow,
transitionMatrix = weatherMatrix, name = "Weather")
The line line gives the following error:
"Error in getClass(Class, where = topenv(parent.frame())) :
“markovchain” is not a defined class"
How do i resolve this? Thanks.