bw.modalreg.circ.lin: Smoothing parameter selection for circular multimdodal...

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

bw.modalreg.circ.linR Documentation

Smoothing parameter selection for circular multimdodal regression

Description

Function bw.modalreg.circ.lin provides the modal cross-validation smoothing parameters for the multimodal regression estimator when the covariate is circular and the response variable is linear.

Function bw.modalreg.circ.circ provides the modal cross-validation smoothing parameters for the multimodal regression estimator when the covariate and the response variable are circular.

Function bw.modalreg.lin.circ provides the modal cross-validation smoothing parameters for the multimodal regression estimator when the covariate is linear and the response variable is circular.

Usage


bw.modalreg.circ.lin(x, y, lower = NULL, upper = NULL, maxit = 500, tol = 0.00001)
bw.modalreg.circ.circ(x, y, lower = NULL, upper = NULL, maxit = 500, tol = 0.00001)
bw.modalreg.lin.circ(x, y, lower = NULL, upper = NULL, maxit = 500, tol = 0.00001)

Arguments

x

Vector of data for the independent variable. The object is coerced to class circular when using functions bw.modalreg.circ.lin and bw.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 bw.modalreg.circ.circ and bw.modalreg.lin.circ.

lower, upper

Vectors of length two with the lower and upper boundaries of the intervals to be used in the search for the values of the smoothing parameters.

maxit

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

tol

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

Details

See Alonso-Pena and Crujeiras (2022) for details.

The NAs will be automatically removed.

Value

A vector of length two with the first component being the value of the smoothing parameter associated to the predictor variable and with the second component being the value of the smoothing parameter associated to the response variable.

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

modalreg.circ.lin, modalreg.circ.circ, 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))
  bw<-bw.modalreg.circ.lin(theta, y)
  
  # 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)
  bw<-bw.modalreg.lin.circ(x, phi)
  
  # 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)
  bw<-bw.modalreg.lin.circ(theta, phi)


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