Skip to contents

Posterior distributions for transformation coefficients in full or summarized form.

Usage

# S3 method for tridim_transformation
coef(
  object,
  summary = TRUE,
  probs = c(0.055, 0.945),
  convert_euclidean = FALSE,
  ...
)

Arguments

object

An object of class tridim_transformation.

summary

Whether summary statistics should be returned instead of raw sample values. Defaults to TRUE

probs

The percentiles used to compute summary, defaults to 89% credible interval.

convert_euclidean

Whether to convert matrix coefficients to scale(phi) and rotation(theta). Defaults to FALSE.

...

Unused

Value

If summary=FALSE, a list with matrix iterationsN x dimensionsN for each variable. If summary=TRUE, a data.frame with columns "dvindex" with mean for each dependent variable plus optional quantiles columns with names "dvindex_quantile".

Examples

euc2 <- fit_transformation(depV1+depV2~indepV1+indepV2,
                           data = NakayaData,
                           transformation = 'euclidean')
#> 
#> SAMPLING FOR MODEL 'tridim_transformation' NOW (CHAIN 1).
#> Chain 1: 
#> Chain 1: Gradient evaluation took 0.001 seconds
#> Chain 1: 1000 transitions using 10 leapfrog steps per transition would take 10 seconds.
#> Chain 1: Adjust your expectations accordingly!
#> Chain 1: 
#> Chain 1: 
#> Chain 1: Iteration:    1 / 2000 [  0%]  (Warmup)
#> Chain 1: Iteration:  200 / 2000 [ 10%]  (Warmup)
#> Chain 1: Iteration:  400 / 2000 [ 20%]  (Warmup)
#> Chain 1: Iteration:  600 / 2000 [ 30%]  (Warmup)
#> Chain 1: Iteration:  800 / 2000 [ 40%]  (Warmup)
#> Chain 1: Iteration: 1000 / 2000 [ 50%]  (Warmup)
#> Chain 1: Iteration: 1001 / 2000 [ 50%]  (Sampling)
#> Chain 1: Iteration: 1200 / 2000 [ 60%]  (Sampling)
#> Chain 1: Iteration: 1400 / 2000 [ 70%]  (Sampling)
#> Chain 1: Iteration: 1600 / 2000 [ 80%]  (Sampling)
#> Chain 1: Iteration: 1800 / 2000 [ 90%]  (Sampling)
#> Chain 1: Iteration: 2000 / 2000 [100%]  (Sampling)
#> Chain 1: 
#> Chain 1:  Elapsed Time: 0.099 seconds (Warm-up)
#> Chain 1:                0.117 seconds (Sampling)
#> Chain 1:                0.216 seconds (Total)
#> Chain 1: 

# full posterior distribution
transform_posterior <- coef(euc2, summary=FALSE)

# coefficients' summary with 89% CI
coef(euc2)
#>   Coef        Mean          5.5       94.5
#> 1   a1  0.14168824 -0.003076626  0.2963707
#> 2   a2 -0.01401752 -0.179774781  0.1542889
#> 3   b1  1.34420438  1.231150184  1.4530545
#> 4   b2 -0.56897204 -0.683137157 -0.4677070

# scale and rotation coefficients
coef(euc2, convert_euclidean=TRUE)
#>       Coef        Mean          5.5       94.5
#> 1       a1  0.14168824 -0.003076626  0.2963707
#> 2       a2 -0.01401752 -0.179774781  0.1542889
#> 3    scale  1.46127601  1.347138581  1.5690809
#> 4 rotation -0.40028226 -0.473700616 -0.3291547