kern.dpreg.circ {NPCirc}R Documentation

Joint kernel estimation of mean and dispersion functions in circular double Poisson models

Description

Function kern.dpreg.circ implements the nonparametric joint estimator of the mean and dispersion functions when the covariate is circular and the conditional distribution is a double Poisson, a particular case of the double exponential family. It takes the von Mises distribution as the kernel employed for both the estimation of the mean and the dispersion. The employed estimator is a local-linear type.

Usage

kern.dpreg.circ(x, y, t = NULL, bw, startvmu = NULL, startvgam = NULL, tol= 0.000001,
  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 and should contain counts.

t

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

bw

Numeric vector of length two containing the smoothing (concentration) parameters used. The first component is the parameter used for the estimation of the mean, while the second component is used for estimating the dispersion. The value of the smoothing parameters can be chosen by using bw.joint.dpcirc.

startvmu

Vector of length two containing the initial values for the parameters corresponding to the estimation of the mean.

startvgam

Vector of length two containing the initial values for the parameters corresponding to the estimation of the dispersion.

tol

Tolerance parameter for convergence in the numerical estimation.

maxit

Maximum number of iterations in the numerical estimation.

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 function is to be estimated.

Details

See Alonso-Pena et al. (2022) for details.

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.

estim

A list containing the estimated values of the logarithm of the mean function (first component) and the logarithm of the dispersion function (second component).

bw

The vector of smoothing parameters 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). Flexible joint modeling of mean and dispersion for the directional tuning of neuronal spike counts. Under review.

See Also

bw.joint.dpcirc

Examples


data(spikes)
direction<-circular(spikes$direction,units="degrees")
counts<-spikes$counts
output<-kern.dpreg.circ(direction, counts, bw=c(7.41,4.47))

 # Plot the data
plot(as.numeric(output$datax),output$datay,pch=16,xlab="Stimulus direction",
      ylab="Spike number")
# Represent the estimated mean
points(as.numeric(output$x),exp(output$estim[[1]]),type="l",col=2,lwd=2)

# Represent the estimated dispersion
plot(as.numeric(output$x),exp(output$estim[[2]]),type="l",col=2,lwd=2,
      xlab="Stimulus direction",ylab="Dispersion")


[Package NPCirc version 3.1.1 Index]