circ.local.lik {NPCirc}R Documentation

Local likelihood estimation for regression with circular covariate

Description

Function circ.local.lik computes a nonparametric estimation of a curve of interest, regarded as a transformation of the mean regression function, when the predictor is circular and the conditional density is either gaussian, Bernoulli, Poisson or gamma. It also computes the derivatives of the function of interest. It uses the method described in Alonso-Pena et al. (2022).

Usage

circ.local.lik(x, y, t = NULL, bw = NULL, family, p = 1,
  startv = NULL, tol = 0.00001, maxit = 300, from = circular(0),
  to = circular(2 * pi),len = 250)

Arguments

x

Vector of data for the independent variable. The object is coerced to class circular.

y

Vector of data for the dependent variable. This must be same length as x.

t

Points where the regression function is estimated. If NULL, equally spaced points are used according to the parameters from, to and len.

bw

Value of the smoothing (concentration) parameter used. The value of the smoothing parameter can be chosen by using bw.circ.local.lik.

family

Character string indicating the conditional density to be used. It must be one of "gaussian", "bernoulli", "poisson" or "gamma". When family = "gaussian", the conditional mean is estimated; when family = "bernoulli", the logit function is estimated and when family = "poisson" or family = "gamma", the function of interest is the logarithm of the conditional mean.

p

Degree of the local sine-polynomial to be used in the estimation process. It must be 1 or 3.

startv

Vector containing the initial values for the estimation algorithm if family is set as "bernoulli", "poisson" or "gamma". The vector must be of length 2 if p = 1 and length 4 if p = 3. If NULL, the initial parameters are the ones corresponding to the global mean of the responses.

tol

Tolerance parameter for convergence in the numerical estimation. Only needed if family is one of "bernoulli", "poisson" or "gamma". Default is tol = 0.00001.

maxit

Maximum number of iterations in the numerical estimation. Only needed if family is one of "bernoulli", "poisson" or "gamma". Default is maxit = 300.

from, to

Left and right-most points of the grid at which the density is to be estimated. The objects are coerced to class circular.

len

Number of equally spaced points at which the density is to be estimated.

Details

See Alonso-Pena et al. (2022).

The NAs will be automatically removed.

Value

A list containing the following components:

datax, datay

Original dataset.

x

The n coordinates of the points where the regression function and its derivatives are estimated.

y

A list containing the estimated values of the function of interest and its derivatives up to order p.

bw

The smoothing parameter used.

n

The sample size after elimination of missing values.

call

The call which produced the result.

data.name

The deparsed name of the x argument.

has.na

Logical, for compatibility (always FALSE).

Author(s)

Maria Alonso-Pena, Irene Gijbels and Rosa M. Crujeiras.

References

Alonso-Pena, M., Gijbels, I. and Crujeiras, R.M. (2022). A general framework for circular local likelihood regression. Under review.

See Also

bw.circ.local.lik

Examples


data(spikes)
direction<-circular(spikes$direction,units="degrees")
counts<-spikes$counts
circ.local.lik(direction, counts, bw=8, p=1, family="poisson")


[Package NPCirc version 3.1.1 Index]