local_lin_proba | R Documentation |
Estimates probabilities that S = 0, ..., Tobsd using local linear regression. We use a Gaussian kernel, and then constrain probabilities to be positive and to sum up to 1.The kernel estimator of the density is also given in output.
local_lin_proba(data, h = 1)
data |
is an environment variable containing the relevant data: - data$S a vector of size n counting for each individual the number of periods for which Y = 1. - data$X an array of size n x Tmax x dimX containing the values of the covariates X. |
h |
(default 1) the bandwidth for the local linear regressions. We increase it at points where the regression is degenerate otherwise. It should have size Tmax + 1, where the j-th value is the bandwidth used for estimating the value of the P(S = j - 1 | X)'s. If h is too short, the last value is repeated for all subsequent j's. |
a list containing: - condlProbas: a matrix of size n x (Tmax + 1) containing, in position (i, j), the estimate for P(S = j - 1 | X) at the i-th observation. - densityEstimate: a matrix of size n x (Tmax + 1) containing, at each row (individual), the estimated density for having covariates (X_1, ..., X_T). Each column represents the value found using the corresponding bandwidths from h.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.