convert_space: Re-express a given vector space in a target space

Description Usage Arguments Value Examples

View source: R/convert_space.R

Description

Re-express a given vector space in a target space

Usage

1
convert_space(df_given, df_target, ktol = 1e+06)

Arguments

df_given

full rank matrix (thin or square)

df_target

full rank matrix (thin or square)

ktol

condition number stopping tolerance

Value

square coefficient matrix

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
df_given <-
  tribble(
    ~out_name, ~W1, ~W2,
         "X1",   1,  -1,
         "X2",   1,   0,
         "X3",   0,   1
  )

df_target <-
  tribble(
   ~out_name, ~V1, ~V2,
        "X1",   1,   0,
        "X2",   1,   1,
        "X3",   0,   1
  )

df_V2W <- convert_space(df_given, df_target)

df_t <- matched_inner(df_target, transpose(df_V2W)) %>%
  mutate(out_name = df_target %>% names() %>% setdiff(., "out_name"))
transpose(df_t)

zdelrosario/piMat documentation built on Jan. 2, 2020, 12:03 p.m.