Description Usage Arguments Details Value Author(s) See Also Examples
Derives the scaled/standardized RAM matrices.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | RAMScaled(A, S, Filter, C = NULL, C.scaled = NULL, check = TRUE, ...)
## Default S3 method:
RAMScaled(A, S, Filter, C = NULL, C.scaled = NULL, check = TRUE, ...)
## S3 method for class 'yac_symbol'
RAMScaled(
A,
S,
Filter,
C = NULL,
C.scaled = NULL,
check = TRUE,
exe = TRUE,
R = FALSE,
format = "ysym",
simplify = FALSE,
...
)
|
A |
|
S |
|
Filter |
|
C |
|
C.scaled |
|
check |
Logical.
If |
... |
... |
exe |
Logical.
If |
R |
Logical.
If |
format |
Character string.
Only used when |
simplify |
Logical. Simplify symbolic results. |
The scaled/standardized \mathbf{A} and \mathbf{S} are given by
\mathbf{A}_{\mathrm{scaled}} = \mathbf{D} \mathbf{A} \mathbf{D}^{-1}
\mathbf{S}_{\mathrm{scaled}} = \mathbf{D} \mathbf{S} \mathbf{D}
where \mathbf{D} is a diagonal matrix whose diagonal elements are the diagonal elements of \mathbf{C} raised to -\frac{1}{2}, that is, the inverse of the standard deviations of the variables.
Returns a list with the following elements
t by t
matrix \mathbf{A}_{\mathrm{scaled}}.
Scaled/standardized asymmetric paths (single-headed arrows),
such as regression coefficients and factor loadings.
t by t
numeric matrix \mathbf{S}_{\mathrm{scaled}}.
Scaled/standardized symmetric paths (double-headed arrows),
such as variances and covariances.
Ivan Jacob Agaloos Pesigan
Other RAM matrices functions:
C()
,
Expectations()
,
E()
,
IminusA()
,
M()
,
S()
,
g()
,
u()
,
v()
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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | # Numeric -----------------------------------------------------------
# This is a numerical example for the model
# y = alpha + beta * x + e
# y = 0 + 1 * x + e
#--------------------------------------------------------------------
A <- S <- matrixR::ZeroMatrix(3)
A[1, ] <- c(0, 1, 1)
diag(S) <- c(0, 0.25, 1)
colnames(A) <- rownames(A) <- c("y", "x", "e")
Filter <- diag(2)
Filter <- cbind(Filter, 0)
colnames(Filter) <- c("y", "x", "e")
(RAM <- RAMScaled(A, S, Filter))
C(A = RAM$A.scaled, S = RAM$S.scaled)
M(A = RAM$A.scaled, S = RAM$S.scaled, Filter = Filter)
# Symbolic ----------------------------------------------------------
# This is a symbolic example for the model
# y = alpha + beta * x + e
# y = 0 + 1 * x + e
#--------------------------------------------------------------------
A <- S <- matrixR::ZeroMatrix(3)
A[1, ] <- c(0, "beta", 1)
diag(S) <- c(0, "sigmax2", "sigmae2")
(RAM <- RAMScaled(Ryacas::ysym(A), S, Filter))
RAMScaled(Ryacas::ysym(A), S, Filter, format = "str")
RAMScaled(Ryacas::ysym(A), S, Filter, format = "tex")
RAMScaled(Ryacas::ysym(A), S, Filter, R = TRUE)
C(A = RAM$A.scaled, S = RAM$S.scaled)
M(A = RAM$A.scaled, S = RAM$S.scaled, Filter = Filter)
# Assigning values to symbols
beta <- 1
sigmax2 <- 0.25
sigmae2 <- 1
RAMScaled(Ryacas::ysym(A), S, Filter)
RAMScaled(Ryacas::ysym(A), S, Filter, format = "str")
RAMScaled(Ryacas::ysym(A), S, Filter, format = "tex")
RAMScaled(Ryacas::ysym(A), S, Filter, R = TRUE)
eval(RAMScaled(Ryacas::ysym(A), S, Filter, R = TRUE))
C(A = RAM$A.scaled, S = RAM$S.scaled)
M(A = RAM$A.scaled, S = RAM$S.scaled, Filter = Filter)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.