circtree: Distributional Regression Tree for a Circular Response

Description Usage Arguments Details Value See Also Examples

View source: R/circtree.R

Description

Distributional trees based on maximum-likelihood estimation of parameters for a circular response employing the von Mises distribution.

Usage

1
2
3
circtree(formula, data, response_range = NULL, subset, na.action = na.pass,
         weights, offset, cluster, control = disttree_control(...),
         converged = NULL, scores = NULL, doFit = TRUE, ...)

Arguments

formula

a symbolic description of the model to be fit. This should be of type y ~ x1 + x2 where y should be the response variable and x1 and x2 are used as partitioning variables.

data

an optional data frame containing the variables in the model.

response_range

an optional vector specifying a range of the circular response.

subset

an optional vector specifying a subset of observations to be used in the fitting process.

na.action

a function which indicates what should happen when the data contain missing value.

weights

optional numeric vector of case weights.

offset

an optional vector of offset values.

cluster

an optional factor indicating independent clusters. Highly experimental, use at your own risk.

control

control arguments passed to extree_fit via disttree_control.

converged

an optional function for checking user-defined criteria before splits are implemented.

scores

an optional named list of scores to be attached to ordered factors.

doFit

a logical indicating if the tree shall be grown (TRUE) or not FALSE

...

arguments to be used to form the default control argument if it is not supplied directly.

Details

Distributional regression trees for a circular response are an application of model-based recursive partitioning and unbiased recursive partitioning based on the implementation in disttree using the infrastructure of extree_fit.

Value

An object of S3 class circtree inheriting from class disttree.

See Also

disttree, distfit, extree_fit

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
## example on parameter range:
sdat.par <- circtree_simulate(response_range = c(-pi, pi))
ct.par <- circtree(y ~ x1 + x2, data = sdat.par)
plot(ct.par)

## example on response range (0, 2pi):
sdat.rad <- circtree_simulate(response_range = c(0, 2*pi))
ct.rad <- circtree(y ~ x1 + x2, data = sdat.rad)
## default: type = "response"
plot(ct.rad, tp_args = list(type = "parameter"))
plot(ct.rad, tp_args = list(type = "response"))

## example on response range (0, 360):
sdat.deg <- circtree_simulate(response_range = c(0, 360))
ct.deg <- circtree(y ~ x1 + x2, data = sdat.deg)
plot(ct.deg, tp_args = list(type = "parameter"))
plot(ct.deg, tp_args = list(type = "response"))
plot(ct.deg, tp_args = list(plot_type = "geographics"))

## example on response range (0, 24):
sdat.hour <- circtree_simulate(response_range = c(0, 24))
ct.hour <- circtree(y ~ x1 + x2, data = sdat.hour, response_range = c(0, 24))
plot(ct.hour, tp_args = list(type = "parameter"))
plot(ct.hour, tp_args = list(type = "response", plot_type = "time"))
plot(ct.hour, tp_args = list(type = "response", plot_type = "time", 
  circlab = c("no", "mo", "mi", "ev")))

circtree documentation built on Aug. 14, 2019, 3 p.m.