Learn R Programming

mapfit (version 0.9.9)

phfit.point: PH fitting with point data

Description

Estimates PH parameters from point data.

Usage

phfit.point(
  ph,
  x,
  weights,
  method = c("all", "increment"),
  lbound = 1,
  ubound = NULL,
  control = list(),
  verbose = list(),
  ...
)

Arguments

ph

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

x

A vector for point data.

weights

A vector of weights for points.

method

The name of estimation method for hyper Erlang ('>herlang).

lbound

A value for lower limit for the number of states in hyper Erlang ('>herlang).

ubound

A value for upper limit for the number of states in hyper Erlang ('>herlang).

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 phfit.result;

model

an object for estimated PH class ('>ph, '>cf1, '>herlang).

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).

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

phfit.group, phfit.density, '>ph, '>cf1 and '>herlang

Examples

Run this code
# NOT RUN {
## make sample
wsample <- rweibull(n=100, shape=2, scale=1)

## PH fitting for general PH
(result1 <- phfit.point(ph=ph(2), x=wsample))

## PH fitting for CF1
(result2 <- phfit.point(ph=cf1(2), x=wsample))

## PH fitting for hyper Erlang
(result3 <- phfit.point(ph=herlang(3), x=wsample))

## mean
ph.mean(result1$model)
ph.mean(result2$model)
ph.mean(result3$model)

## variance
ph.var(result1$model)
ph.var(result2$model)
ph.var(result3$model)

## up to 5 moments 
ph.moment(5, result1$model)
ph.moment(5, result2$model)
ph.moment(5, result3$model)

# }

Run the code above in your browser using DataLab