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 |
y |
Vector of data for the dependent variable. This must be same length as |
t |
Points where the regression function is estimated. If |
bw |
Value of the smoothing (concentration) parameter used. The value of the smoothing parameter can be chosen by using |
family |
Character string indicating the conditional density to be used. It must be one of |
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 |
tol |
Tolerance parameter for convergence in the numerical estimation. Only needed if family is one of |
maxit |
Maximum number of iterations in the numerical estimation. Only needed if family is one of |
from , to |
Left and right-most points of the grid at which the density is to be estimated. The objects are coerced to class |
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 |
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
Examples
data(spikes)
direction<-circular(spikes$direction,units="degrees")
counts<-spikes$counts
circ.local.lik(direction, counts, bw=8, p=1, family="poisson")