View source: R/fit_transformation.R
fit_transformation | R Documentation |
Fits Bidimensional or Tridimensional regression / geometric transformation models using
Stan engine. The formula
described dependent and independent numeric variables in the
data
. See also fit_transformation_df
.
For the 2D data, you can fit "translation"
(2 parameters for translation only), "euclidean"
(4 parameters: 2 for translation, 1 for scaling, and 1 for rotation),
"affine"
(6 parameters: 2 for translation and 4 that jointly describe scaling, rotation and sheer),
or "projective"
(8 parameters: affine plus 2 additional parameters to account for projection).
For 3D data, you can fit "translation"
(3 for translation only), "euclidean_x"
, "euclidean_y"
,
"euclidean_z"
(5 parameters: 3 for translation scale, 1 for rotation, and 1 for scaling),
"affine"
(12 parameters: 3 for translation and 9 to account for scaling, rotation, and sheer),
and "projective"
(15 parameters: affine plus 3 additional parameters to account for projection).
transformations.
For details on transformation matrices and computation of scale and rotation parameters please
see vignette("transformation_matrices", package = "TriDimRegression")
## S3 method for class 'formula'
fit_transformation(
formula,
data,
transformation,
priors = NULL,
chains = 1,
cores = NULL,
...
)
formula |
a symbolic description of the model to be fitted in the format |
data |
a data frame containing variables for the model. |
transformation |
the transformation to be used: |
priors |
named list of parameters for prior distributions of parameters |
chains |
Number of chains for sampling. |
cores |
Number of CPU cores to use for sampling. If omitted, all available cores are used. |
... |
Additional arguments passed to |
A tridim_transformation object
fit_transformation_df
# Geometric transformations of 2D data
euc2 <- fit_transformation(depV1 + depV2 ~ indepV1 + indepV2,
NakayaData, 'euclidean')
aff2 <- fit_transformation(depV1 + depV2 ~ indepV1 + indepV2,
NakayaData, 'affine')
prj2 <- fit_transformation(depV1 + depV2 ~ indepV1 + indepV2,
NakayaData, 'projective')
# summary of transformation coefficients
coef(euc2)
# statistical comparison via WAIC criterion
loo::loo_compare(waic(euc2), waic(aff2), waic(prj2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.