stray_transforms: Transform Fit Stray Parameters to other representations

Description Usage Arguments Details Value Examples

Description

These are a collection of convenience functions for transforming stray fit objects to a number of different representations including ILR bases, CLR coordinates, ALR coordinates, and proportions.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
to_proportions(m)

to_alr(m, d)

to_ilr(m, V = NULL)

to_clr(m)

## S3 method for class 'pibblefit'
to_proportions(m)

## S3 method for class 'orthusfit'
to_proportions(m)

## S3 method for class 'pibblefit'
to_alr(m, d)

## S3 method for class 'orthusfit'
to_alr(m, d)

## S3 method for class 'pibblefit'
to_ilr(m, V = NULL)

## S3 method for class 'orthusfit'
to_ilr(m, V = NULL)

## S3 method for class 'pibblefit'
to_clr(m)

## S3 method for class 'orthusfit'
to_clr(m)

Arguments

m

object of class pibblefit or orthusfit (e.g., output of pibble or orthus)

d

(integer) multinomial category to take as new alr reference

V

(matrix) contrast matrix for ILR basis to transform into to (defaults to driver::create_default_ilr_base(D))

Details

For orthus, transforms only appleid to log-ratio parameters

Note: that there is a degeneracy of representations for a covariance matrix represented in terms of proportions. As such the function to_proportions does not attempt to transform parameters Sigma or prior Xi and instead just removes them from the pibblefit object returned.

Value

object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
m <- pibble(Y, X)
m.prop <- to_proportions(m)
# convert back to default coordinates (alr with D-th part as reference)
m <- to_alr(m.prop, ncategories(m))
V <- driver::create_default_ilr_base(ncategories(m))
m.ilr <- to_ilr(m, V)
m.clr <- to_clr(m)

## End(Not run)

jsilve24/mongrel documentation built on Jan. 27, 2022, 9:54 p.m.