orientlm | R Documentation |
Regression models for matched pairs of orientations.
orientlm(observed, leftformula, trueorient = rotmatrix(diag(3)), rightformula, data = list(), subset, weights, na.action, iterations = 5)
observed |
Observed orientations |
leftformula |
Formula for “left” model (see below) |
trueorient |
“True” orientation (see below) |
rightformula |
Formula for “right” model (see below) |
data |
Optional data frame for predictors in linear model |
subset |
Optional logical vector indicating subset of data |
weights |
Optional weights |
na.action |
Optional NA function for predictors |
iterations |
How many iterations to use. Ignored unless both
|
The Prentice (1989) model for matched pairs of orientations was
E(Vi) = k t(A1) %*% Ui %*% A2
where Vi is the observed orientation, A1 and A2 are orientation matrices, and Ui is the “true” orientation, and k is a constant. It was assumed that errors were symmetrically distributed about the identity matrix.
This function generalizes this model, allowing A1 and A2 to depend on
regressor variables through leftformula
and rightformula
respectively.
These formulas should include the predictor variables (right hand side) only, e.g. use
~ x + y + z
rather than response ~ x + y + z
. Specify the response using
the observed
argument. If
both formulas are ~ 1
, i.e. intercepts only, then Prentice's original model is
recovered. More general models are fit by coordinatewise linear regression in the rotmatrix
representation of the orientation, with fitted values projected onto SO(3) using the
nearest.SO3
function.
When both left and right models are given, Prentice's iterative approach is used with a fixed number of iterations. Note that Shin (1999) found that Prentice's scheme sometimes fails to find the global minimum; this function presumably suffers from the same failing.
Returns a list containing the following components:
leftfit |
Result of |
rightfit |
Result of |
A1 |
Fitted values of A1 for each observation |
A2 |
Fitted values of A2 for each observation |
predict |
Fitted values of t(A1) %*% Ui %*% A2 for each observation |
Duncan Murdoch
Prentice, M.J. (1989). Spherical regression on matched pairs of orientation statistics. JRSS B 51, 241-248.
Shin, H.S.H. (1999). Experimental Design for Orientation Models. PhD thesis, Queen's University.
x <- rep(1:10,10) y <- rep(1:10,each=10) A1 <- skewvector(cbind(x/10,y/10,rep(0,100))) A2 <- skewvector(c(1,1,1)) trueorientation <- skewvector(matrix(rnorm(300),100)) noise <- skewvector(matrix(rnorm(300)/10,100)) obs <- t(A1) %*% trueorientation %*% A2 %*% noise fit <- orientlm(obs, ~ x + y, trueorientation, ~ 1) context <- boat3d(A1, x, z=y, col = 'green', graphics='scatterplot3d') boat3d(fit$A1, x, z=y, add=context)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.