Description Usage Arguments Details Value Author(s) See Also Examples

Create a 3d plot from a local polynomial fit of two covariates and a response variable.

1 2 3 4 5 6 | ```
plot3d.localpoly.reg(X,Y, bandwidth = "CV", gridsize = 30,
degree.pol = 0, kernel.type = "epanech", gridsurface = 30,
xlab=expression(X_1), ylab=expression(X_2),
zlab=expression(Y), theta = 30, phi = 30, expand = 0.5,
col = "lightblue", ltheta = 120, shade = 0.75,
ticktype = "detailed", pch = 16,...)
``` |

`X` |
n by 2 matrix with observations, rows corresponding to data points and columns correspond to covariates. |

`Y` |
vector of observed responses. |

`bandwidth` |
bandwidth, vector or matrix. If "CV", leave-one-out cross validation with criterion of minimum MSE is performed to select a unique bandwidth that will be used for all dimensions of X; if "GCV", Generalized Cross Validation is performed to select a unique bandwidth that will be used for all dimensions of X; if "CV2" leave-one-out cross validation for each covariate; and if "GCV2", GCV for each covariate. It may be a vector for each dimension of the X; or a matrix of bandwidths (not to be confused with bandwidth matrix H), where each row is a vector of size 2, representing a bandwidth that changes with the location of estimation for the grid. See localpoly.reg. |

`gridsize` |
number of possible bandwidths to be searched in cross-validation. If left as |

`degree.pol` |
degree of the polynomial to be used in the local fit. |

`kernel.type` |
kernel type, options are "box", "trun.normal", "gaussian", "epanech", |

`gridsurface` |
number of points on each axis at which to estimate the local polynomial surface. |

`xlab` |
parameter for persp |

`ylab` |
parameter for persp |

`zlab` |
parameter for persp |

`theta` |
parameter for persp |

`phi` |
parameter for persp |

`expand` |
parameter for persp |

`col` |
parameter for persp |

`ltheta` |
parameter for persp |

`shade` |
parameter for persp |

`ticktype` |
parameter for persp |

`pch` |
parameter for persp |

`...` |
further parameters for plotting persp |

Uses function "persp" to plot the estimated surface of a local polynomial fit in a nonparametric model with two covariates. The surface is estimated at points of a grid with size "gridsurface", which are evenly distributed between the minimum and maximum of the observed predictors. It also adds the observed points to the plot.

`X` |
the same input matrix |

`Y` |
the same input response vector |

`points` |
points at which to get smoothed values |

`bandwidth` |
bandwidth used for the polynomial fit |

`predicted` |
matrix with the predicted values at grid points |

Adriano Zanin Zambom <adriano.zambom@gmail.com>

1 2 3 4 5 6 7 |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.