Learn R Programming

mapfit (version 0.9.7)

mapfit.point: MAP fitting with time point data

Description

estimates MAP parameters from time point data.

Usage

mapfit.point (map, x, intervals, stationary = TRUE,
  method = c("all", "increment"), lbound = 1, ubound = NULL,
  control = list(), verbose = list(), ...)

Arguments

map

an object of S4 class for MAP. The estimation algorithm is selected depending on thie class.

x

a vector for time sequence of arrivals. This is equivalent to cumsum(intervals). Either time or difftime should be given.

intervals

a vector for the data for intrarrival time. This is equivalent to diff(c(0,x)). Either time or difftime should be given.

stationary

a logical value that determine whether initial probability is given by a stationary vector of underlying Markov process or not.

method

the name of estimation method for ER-HMM ('>erhmm).

lbound

a value for lower limit for the number of states in ER-HMM ('>erhmm).

ubound

a value for upper limit for the number of states in ER-HMM ('>erhmm).

control

a list of parameters for controlling the fitting process.

verbose

a list of parameters for displaying the fitting process.

further arguments for methods.

Value

returns a list with components, which is an object of S3 class mapfit.result;

model

an object for estimated MAP class ('>map, '>erhmm).

llf

a value of the maximum log-likelihood.

df

a value of degrees of freedom of the model.

aic

a value of Akaike information criterion.

iter

the number of iterations.

convergence

a logical value for the convergence of estimation algorithm.

ctime

computation time (user time).

stationary

a logical value for the argument stationary.

data

an object for MAP data class

aerror

a value of absolute error for llf at the last step of algorithm.

rerror

a value of relative error for llf at the last step of algorithm.

control

a list of the argument of control.

verbose

a list of the argument of verbose.

call

the matched call.

See Also

mapfit.group, '>map and '>erhmm

Examples

Run this code
# NOT RUN {
## load trace data
data(BCpAug89)
BCpAug89s <- head(BCpAug89, 50)

## MAP fitting for general MAP
(result1 <- mapfit.point(map=map(2), x=cumsum(BCpAug89s)))

## MAP fitting for MMPP
(result2 <- mapfit.point(map=mmpp(2), x=cumsum(BCpAug89s)))

## MAP fitting for ER-HMM
(result3 <- mapfit.point(map=erhmm(3), x=cumsum(BCpAug89s)))

## marginal moments for estimated MAP
map.mmoment(k=3, map=result1$model)
map.mmoment(k=3, map=result2$model)
map.mmoment(k=3, map=as(result3$model, "map"))

## joint moments for estimated MAP
map.jmoment(lag=1, map=result1$model)
map.jmoment(lag=1, map=result2$model)
map.jmoment(lag=1, map=as(result3$model, "map"))

## lag-k correlation
map.acf(map=result1$model)
map.acf(map=result2$model)
map.acf(map=as(result3$model, "map"))

# }

Run the code above in your browser using DataLab