modalreg.circ.lin: Circular multimodal regression estimation

View source: R/modalreg.circ.lin.R

modalreg.circ.linR Documentation

Circular multimodal regression estimation

Description

Function modalreg.circ.lin implements the nonparametric multimodal regression estimator for a circular covariate and a real-valued response, as described in Alonso-Pena and Crujeiras (2022). It takes the von Mises distribution as the kernel associated to the predictor variable and the normal distribution as the kernel associated to the response variable.

Function modalreg.circ.circ implements the nonparametric multimodal regression estimator for a circular covariate and a circular response, as described in Alonso-Pena and Crujeiras (2022). It takes the von Mises distribution as the kernel associated to the predictor variable and the response variables.

Function modalreg.lin.circ implements the nonparametric multimodal regression estimator for a real-valued covariate and a circular response, as described in Alonso-Pena and Crujeiras (2022). It takes the normal distribution as the kernel associated to the predictor variable and the von Mises distribution as the kernel associated to the response variable.

Usage

modalreg.circ.lin(x, y, t=NULL, bw=NULL, tol = 0.0001, maxit = 500,
    from = circular(0),to = circular(2 * pi), len = 300)

modalreg.circ.circ(x, y, t=NULL, bw=NULL, tol = 0.00001,
    maxit = 500, from = circular(0), to = circular(2 * pi), len = 300)

modalreg.lin.circ(x, y, t=NULL, bw=NULL, tol = 0.0001, maxit = 500, len=300)

Arguments

x

Vector of data for the independent variable. The object is coerced to class circular when using functions modalreg.circ.lin and modalreg.circ.circ.

y

Vector of data for the dependent variable. This must be same length as x. The object is coerced to class circular when using functions modalreg.circ.circ and modalreg.lin.circ.

t

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

bw

Vector of length two with the values of the smoothing parameters to be used. The first component corresponds to the smoothing parameter associated to the predictor variable and the second component is the parameter associated to the response variable. If NULL, the parameters are selected via modal cross-validation.

tol

Tolerance parameter for convergence in the estimation through the conditional (circular) mean shift.

maxit

Maximum number of iterations in the estimation through the conditional (circular) mean shift.

from, to

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

len

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

Details

See Alonso-Pena and Crujeiras (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 multifunction is estimated.

y

A list with dimension the length of the number of evaluation points containing the estimated values of the multidunfunction for each evaluation point.

bw

A verctor of lenght two with the 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 and Rosa M. Crujeiras.

References

Alonso-Pena, M. and Crujeiras, R. M. (2022). Analizing animal escape data with circular nonparametric multimodal regression. Annals of Applied Statistics. (To appear).

See Also

bw.modalreg.circ.lin, bw.modalreg.circ.circ, bw.modalreg.lin.circ

Examples


  # Circ-lin
  set.seed(8833)
  n1<-100
  n2<-100
  gamma<-8
  sigma<-1.5
  theta1<-rcircularuniform(n1)
  theta2<-rcircularuniform(n2)
  theta<-c(theta1,theta2)
  y1<-2*sin(2*theta1)+rnorm(n1,sd=sigma)
  y2<-gamma+2*sin(2*theta2)+rnorm(n2,sd=sigma)
  y<-as.numeric(c(y1,y2))
  fit<-modalreg.circ.lin(theta,y,bw=c(10,1.3))
  
  # Lin-circ
  n1<-100
  n2<-100
  con<-8
  set.seed(8833)
  x1<-runif(n1)
  x2<-runif(n2)
  phi1<-(6*atan(2.5*x1-3)+rvonmises(n1,m=0,k=con))
  phi2<-(pi+6*atan(2.5*x2-3)+rvonmises(n2,m=0,k=con))
  x<-c(x1,x2)
  phi<-c(phi1,phi2)
  fit<-modalreg.lin.circ(x, phi, bw=c(0.1,2.5))
  
  # Circ-circ
  n1<-100
  n2<-100
  con<-10
  set.seed(8833)
  theta1<-rcircularuniform(n1)
  theta2<-rcircularuniform(n2)
  phi1<-(2*cos(theta1)+rvonmises(n1,m=0,k=con))
  phi2<-(3*pi/4+2*cos(theta2)+rvonmises(n2,m=0,k=con))
  theta=c(theta1,theta2)
  phi=c(phi1,phi2)
  fit<-modalreg.circ.circ(theta, phi, bw=c(30,3))


NPCirc documentation built on Nov. 10, 2022, 5:48 p.m.