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).
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)
A list containing the following components:
Original dataset.
The n coordinates of the points where the regression function and its derivatives are estimated.
A list containing the estimated values of the function of interest and its derivatives up to order p.
The smoothing parameter used.
The sample size after elimination of missing values.
The call which produced the result.
The deparsed name of the x argument.
Logical, for compatibility (always FALSE).
Vector of data for the independent variable. The object is coerced to class circular.
Vector of data for the dependent variable. This must be same length as x.
Points where the regression function is estimated. If NULL, equally spaced points are used according to the parameters from, to and len.
Value of the smoothing (concentration) parameter used. The value of the smoothing parameter can be chosen by using bw.circ.local.lik.
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.
Degree of the local sine-polynomial to be used in the estimation process. It must be 1 or 3.
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.
Tolerance parameter for convergence in the numerical estimation. Only needed if family is one of "bernoulli", "poisson" or "gamma". Default is tol = 0.00001.
Maximum number of iterations in the numerical estimation. Only needed if family is one of "bernoulli", "poisson" or "gamma". Default is maxit = 300.
Left and right-most points of the grid at which the density is to be estimated. The objects are coerced to class circular.
Number of equally spaced points at which the density is to be estimated.
Maria Alonso-Pena, Irene Gijbels and Rosa M. Crujeiras.
See Alonso-Pena et al. (2022).
The NAs will be automatically removed.
Alonso-Pena, M., Gijbels, I. and Crujeiras, R.M. (2022). A general framework for circular local likelihood regression. Under review.
bw.circ.local.lik
# \donttest{
data(spikes)
direction<-circular(spikes$direction,units="degrees")
counts<-spikes$counts
circ.local.lik(direction, counts, bw=8, p=1, family="poisson")
# }
Run the code above in your browser using DataLab