Test Equality of Curves with Homoscedastic or Heteroscedastic Errors.

Description

Fit the smoothing curves.

Usage

1
2
3
4
5
6
7
curvefit(formula, data, kernel = "Quartic", alpha = 0.5, bw = NULL, myx, bcorrect = "simple", getit = F)
## S3 method for class 'curvefit'
print(x,...) 
## S3 method for class 'curvefit'
plot(x,y=NULL, add = F, get.data = TRUE, ...)
## S3 method for class 'curvefit'
lines(x,...)

Arguments

formula

A formula to the data set such as y~x.

data

A data frame of 2 columns representing the underlying curve. The column names must agree with the names in formula.

alpha

Smoothing parameter. Default=0.5.

bw

Window bandwidth for fitting the curve.

kernel

One of the kernel functions to use to fit the curves. Must be one of "Triangle", "Gaussian", "Trio","Uniform", "Triweight", "Epanechnikov", "Quartic". partial match is allowed.

myx

x-values in the test domain to calculate the curve values.

bcorrect

Boundary correction method. Right now, except for 'none', meaning no corrections, the only other opton is 'simple'.

getit

unused for this function.

add

logical, Tf true, add the curves to the plot.Otherwise, add fitted lines to the plot.

get.data

logical, not used in this function.

x

The fitted results from fitting the first or second curve by curvefit procedure.

y

dummy variable for compatible with parameters in the base definition of plot.

...

parameters for plot such as pch, lty, col etc.

Details

For a 2 column data, the curve will be fitted according to formula using local regression method. Boundary corrections can be made. The fitted result will be returned as a 'curvefit' object, that can be plotted and printted by the associated S3 method print and plot.

Value

An R object of class 'curvefit' will be generated including the fitted values of the curves with original specification of parameters.

Author(s)

Zhongfa Zhang, Jiayang Sun

References

Zhongfa Zhang, et al: Test Equality of Curves with Homoscedastic or Heteroscedastic Errors. To appear

See Also

curvefit, print.curvetest, plot.curvetest

Examples

1
2
3
4
5
6
7
8
     x=seq(0,1, length=n<-150);
     f<-function(x){x*(1-x)+sin(2*pi*x)};
     y=f(x)+rnorm(n, 0, 0.5)
     fit<-curvefit(y~x,data.frame(x=x,y=y), bw=0.4,getit=T) 
     plot(fit)
     lines(fit)
     fit ##print