View source: R/kern.dpreg.circ.R
kern.dpreg.circ | R Documentation |
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.
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)
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 |
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 |
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 |
len |
Number of equally spaced points at which the function is to be estimated. |
See Alonso-Pena et al. (2022) for details.
The NAs will be automatically removed.
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). |
Maria Alonso-Pena, Irene Gijbels and Rosa M. Crujeiras
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.
bw.joint.dpcirc
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.