weather: Convert the data into a transition matrix for weather...

Description Usage Arguments Value Examples

Description

This method is used to create a transition matrix from the data of weather

Usage

1
weather(y, weathercolumn, sunny, cloudy, rainy, other = NULL)

Arguments

y

Data of the weather

weathercolumn

The index of the column containing weather types

sunny

The character vector for 'sunny' state

cloudy

The character vector for 'cloudy' state

rainy

The character vector for 'rainy' state

other

The character vector for other weather types. The default value = NULL.

Value

The transition matrix of the Markov chain

Examples

1
2
3
4
data(wsoton)
rainnystate<-c("Light rain", "Moderate rain", "Patchy rain possible",
             "Light drizzle", "Light rain shower")
weather(wsoton,2,c("Sunny"),c("Cloudy","Partly cloudy"),rainnystate,"Overcast")

ZiqingHo/BasicMC documentation built on May 21, 2019, 2:29 a.m.