weight_explanatory_points {nprotreg} | R Documentation |
Weights the Specified Explanatory Points in a 3D Spherical Regression.
Description
Returns the weights assigned to the specified explanatory points for each evaluation point under study, given a concentration parameter.
Usage
weight_explanatory_points(evaluation_points, explanatory_points, concentration)
Arguments
evaluation_points |
An n-by-3 matrix whose rows contain the Cartesian coordinates of the points on which the regression will be estimated. |
explanatory_points |
An m-by-3 matrix whose rows contain the Cartesian coordinates of the explanatory points used to calculate the regression estimators. |
concentration |
A non negative scalar whose reciprocal value is proportional to the bandwidth applied while estimating a spherical regression model. |
Details
Let X
be the m-by-3 matrix of explanatory points, and E
the n-by-3 matrix of evaluation points, and \kappa
the
concentration parameter. This function will return
an m-by-n matrix whose (i,j)
entry is defined as
follows:
exp(\kappa (s(i,j) - 1))
where s(i,j)
is the scalar product of the i
-th row of
X
and the j
-th row of E
.
Value
An m-by-n matrix whose j-th column contains the weights assigned to the explanatory points while analyzing the j-th evaluation point.
See Also
Other Regression functions:
cross_validate_concentration()
,
fit_regression()
,
get_equally_spaced_points()
,
get_skew_symmetric_matrix()
,
simulate_regression()
,
simulate_rigid_regression()
Examples
library(nprotreg)
# Define a matrix of evaluation points.
north_pole <- cbind(0, 0, 1)
south_pole <- cbind(0, 0, -1)
evaluation_points <- rbind(north_pole, south_pole)
# Define a matrix of explanatory points
explanatory_points <- rbind(
cbind(.5, 0, .8660254),
cbind(-.5, 0, .8660254),
cbind(1, 0, 0),
cbind(0, 1, 0),
cbind(-1, 0, 0),
cbind(0, -1, 0),
cbind(.5, 0, -.8660254),
cbind(-.5, 0, -.8660254)
)
# Define a value for the concentration parameter.
concentration <- 1.0
# Get the corresponding 8-by-2 matrix of weights.
# Columns corresponds to evaluation points,
# rows to explanatory ones.
weights <- weight_explanatory_points(evaluation_points,
explanatory_points,
concentration)
# Get the weights assigned to the explanatory points
# while analyzing the second evaluation point.
cat("Weights assigned while analyzing the second evaluation point: \n")
cat(weights[, 2], "\n")