-
Notifications
You must be signed in to change notification settings - Fork 2
/
readme.txt
62 lines (46 loc) · 2.17 KB
/
readme.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
This file contains the R scripts used in the paper “non-parametric modal regression” by Chen et al. The first file “ModalRegression.R” contains the functions for modal regression for the covariate being 1 or 2 dimensions. It can be easily generalized to the case for p-dimension. The other two scripts “Ex1_DualCurve” and “Ex2_3Mixture” are examples for modal regression which includes prediction sets, comparisons and bandwidth selection using minimizing size of prediction set (in “Ex2_3Mixture”).
contact: [email protected]
***ModalRegression.R
This contains two functions: RegMS1d and RegMS2d.
*RegMS1d—
RegMS1d = function(X, Y, G.x=X, G.y=Y, h.x, h.y, iter=100, tolerance=1e-8)
Input:
X: covariate, 1 dimension
Y: response, 1 dimension
G.x: grid of covariate
G.y: grid of response
h.x: smoothing parameter for covariate
h.y: smoothing parameter for response
iter: maximal number of iteration
tolerance: the tolerance level of shifting step
Output:
Estimated local modes from each point of (G.x, G.y)
*RegMS2d—
RegMS2d = function(X,Y, G.x=X, G.y=Y, h.x, h.y, iter=100,tolerance=1e-8)
Input:
X: covariate, 2 dimension
Y: response, 1 dimension
G.x: grid of covariate
G.y: grid of response
h.x: smoothing parameter for covariates
h.y: smoothing parameter for response
iter: maximal number of iteration
tolerance: the tolerance level of shifting step
Output:
Estimated local modes from each point of (G.x, G.y)
***Ex1_DualCurve:
A script on the dual curve simulation data. The analysis includes estimating the modal curves, prediction sets and comparison to the local regression.
*Section 1: Generate Data
*Section 2: Modal regression
*Section 3: Representing by curves
*Section 4: Prediction set (non-optimized)
*Section 5: Comparison to local regression
***Ex2_3Mixture:
A script on the three mixture simulation data. The analysis is essentially the same as dual curve but we also present bandwidth selection and comparison to mixture regression.
*Section 1: Generate Data
*Section 2: Modal Regression
*Section 3: Bandwidth selection via minizming prediction set
*Section 4: Optimal result
*Section 5: Prediction set
*Section 6: Local regression
*Section 7: Mixture regression