############################################################################################
Envelopes in Multivariate Regression Models with Nonlinearity and Heteroscedasticity

by X. Zhang, C.E. Lee, and X. Shao (2020)
############################################################################################


-DESCRIPTION

This folder contains all necessary functions to replicate the results of Model II and Model VI in Zhang, Lee, and Shao (2020, Biometrika). 
Codes to reproduce the results of Model II and Model VI in the paper are provided at Model2.m, Model6.m. 
Note that the functions in 'sg_min' folder, and functions of 'ddF', 'dF', 'F', 'slices', 'setpaths' are from the LDR package by Cook, Forzani, and Tomassi (2011, Journal of Statistical Software).
The ECD algorithm (Cook and Zhang, 2018, Statistica Sinica) was used in estimating the envelopes, but can be replaced with other envelope algorithms.

-CONTENTS

# ddF.m: a general function for computing the second derivative of the objective function.

# dF.m: a general function for computing the derivative of the objective function.

# dF4manifold1D_2ndstep.m: The derivative of the objective function for estimating the second part of CME.

# ECD.m: a function to estimate MDDE.

# ECD1st.m: a function to estimate one direction of MDDE.

# ECDini.m: a function to choose an initial value for ECD1st function.

# ECDini_2_steps.m: a function to choose an initial value of the second part of CME.

# F.m: a general function for computing the objective function.

# F4manifold1D_2ndstep.m: an objective function for estimating the second part of CME.

# first1D_2ndstep.m: a function to estimate one direction of the second part of CME. 

# isinZ.m: a function to check for integer data.

# manifold1D_2ndstep.m: a function to estimate the second part of CME which does not belong to MDDE.

# objF_ECD.m: an objective function for MDDE with 1D algorithm.

# optimECD.m: a function searching one direction of MDDE by optimzing objF_ECD.

# setpaths.m: a start up function to add all the folders in the package to Matlab's search path. 

# slices.m: a function to discretize a continuous response Y into h bins.