Description Usage Arguments Details Value References
View source: R/ProbitSpatial.R
Predicts of a ProbitSpatial
model on a set X
of covariates.
Works on both in-sample and out-of-sample using BLUP formula from Goulard et
al. (2017)
1 2 3 4 5 6 7 8 9 10 |
object |
an object of class |
X |
a matrix of explanatory variables. If oos=TRUE, it may contain more observations than the dataset on which the model has been trained |
type |
the type of output:
|
cut |
the threshold probability for the |
oos |
logical. If TRUE, out-of-sample predictions are returned. |
WSO |
W matrix containing weights of in-sample and out-of-sample data. Observations must be ordered in such a way that the first elements belong to the in-sample data and the remaining ones to the out-of-sample data. |
... |
ignored |
If oos=FALSE
, the function computes the predicted values for #' the estimated model (same as fitted
). Otherwise, it applies the BLUP #' formula of Goulard et al. (2017):
\hat{y} = (\hat(y_S),\hat(y_O)),
where the sub-indexes S and O refer, respectively, to the in-sample and out-of-sample data. \hat{y_S} corresponds to fitted values, while \hat{y_O} is computed as follows:
\hat{y_O} = (I-ρ W)^{-1}(Xβ)-Q_{OO}^{-1}Q_{OS}(y_S-\hat{y_S}),
where Q is the precision matrix of Σ=σ^2((I-ρ W)'(I-ρ W))^{-1}. and the sub-indexes OO and OS refer to the corresponding block matrices.
Returns a vector of predicted values for the set X
of
covariates if oos=FALSE
or the best linear unbiased predictors of the #' set XOS
if oos=TRUE
.
M. Goulard, T. Laurent and C. Thomas-Agnan. About predictions in spatial autoregressive models: optimal and almost optimal strategies. Spatial Economic Analysis 12, 304-325, 2017.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.