Description Usage Arguments Details Value Author(s) References See Also Examples
Derives the mean and covariance expectations from the Reticular Action Model (RAM) matrices.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
A |
|
S |
|
u |
vector of length |
Filter |
|
check |
Logical.
If |
... |
... |
R |
Logical.
If |
format |
Character string.
Only used when |
simplify |
Logical. Simplify symbolic results. |
The vector of expected values \mathbf{v} as a function of Reticular Action Model (RAM) matrices is given by
\mathbf{v} = ≤ft( \mathbf{I} - \mathbf{A} \right)^{\mathsf{T}} \mathbf{u} \\ = \mathbf{E} \mathbf{u}
The vector of expected values of observed variables \mathbf{g} as a function of Reticular Action Model (RAM) matrices is given by
\mathbf{g} = \mathbf{F} ≤ft( \mathbf{I} - \mathbf{A} \right)^{\mathsf{T}} \mathbf{u} \\ = \mathbf{F} \mathbf{E} \mathbf{u} \\ = \mathbf{F} \mathbf{v}
The matrix of covariance expectations \mathbf{C} as a function of Reticular Action Model (RAM) matrices is given by
\mathbf{C} = ≤ft( \mathbf{I} - \mathbf{A} \right)^{-1} \mathbf{S} ≤ft[ ≤ft( \mathbf{I} - \mathbf{A} \right)^{-1} \right]^{\mathsf{T}} \\ = \mathbf{E} \mathbf{S} \mathbf{E}^{\mathsf{T}}
The matrix of covariance expectations for given variables \mathbf{M} as a function of Reticular Action Model (RAM) matrices is given by
\mathbf{M} = \mathbf{F} ≤ft( \mathbf{I} - \mathbf{A} \right)^{-1} \mathbf{S} ≤ft[ ≤ft( \mathbf{I} - \mathbf{A} \right)^{-1} \right]^{\mathsf{T}} \mathbf{F}^{\mathsf{T}} \\ = \mathbf{F} \mathbf{E} \mathbf{S} \mathbf{E}^{\mathsf{T}} \mathbf{F}^{\mathsf{T}} \\ = \mathbf{F} \mathbf{C} \mathbf{F}^{\mathsf{T}}
The matrix of scaled/standardized covariance expectations \mathbf{C}_{\mathrm{scaled}} (also known as correlations) is given by
\mathbf{C}_{\mathrm{scaled}} = \mathbf{D}^{-1} \mathbf{C} \mathbf{D}^{-1}
The matrix of scaled/standardized covariance expectations for given variables \mathbf{M}_{\mathrm{scaled}} (also known as correlations) is given by
\mathbf{M}_{\mathrm{scaled}} = \mathbf{F} \mathbf{C}_{\mathrm{scaled}} \mathbf{F}^{\mathsf{T}}
where
\mathbf{u}_{t \times 1} vector of parameters for the mean structure,
\mathbf{A}_{t \times t} represents asymmetric paths (single-headed arrows), such as regression coefficients and factor loadings,
\mathbf{S}_{t \times t} represents symmetric paths (double-headed arrows), such as variances and covariances,
\mathbf{F}_{p \times t} represents the filter matrix used to select the observed variables,
\mathbf{I}_{t \times t} represents an identity matrix,
\mathbf{D}_{t \times t} represents a diagonal matrix who diagonal elements are the square root of the diagonal elements of \mathbf{C},
p number of observed variables,
q number of latent variables, and
t number of observed and latent variables, that is p + q .
Returns a list with the following elements
t by 1
matrix \mathbf{v}
of expected values.
p by 1
matrix \mathbf{g}
of expected values of observed variables.
t by t
matrix \mathbf{C}
of expected covariances.
p by p
matrix \mathbf{M}
of expected covariances of observed variables.
t by t
matrix \mathbf{C}
of scaled/standardized expected covariances
(also known as correlations).
p by p
matrix \mathbf{M}
of scaled/standardized expected covariances
(also known as correlations)
of observed variables.
Ivan Jacob Agaloos Pesigan
McArdle, J. J., & McDonald, R. P. (1984). Some algebraic properties of the Reticular Action Model for moment structures. British Journal of Mathematical and Statistical Psychology, 37 (2), 234–251. https://doi.org/10.1111/j.2044-8317.1984.tb00802.x
Other RAM matrices functions:
C()
,
E()
,
IminusA()
,
M()
,
RAMScaled()
,
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 | # This is a numerical example for the model
# y = alpha + beta * x + e
# y = 0 + 1 * x + e
# Numeric -----------------------------------------------------------
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")
u <- c(0.00, 0.50, 0.00)
Filter <- diag(2)
Filter <- cbind(Filter, 0)
colnames(Filter) <- c("y", "x", "e")
Expectations(A, S, u, Filter)
# Symbolic ----------------------------------------------------------
A <- S <- matrixR::ZeroMatrix(3)
A[1, ] <- c(0, "beta", 1)
diag(S) <- c(0, "sigmax2", "sigmae2")
u <- c("alpha", "mux", 0)
Expectations(Ryacas::ysym(A), S, u, Filter, R = FALSE, format = "ysym")
Expectations(Ryacas::ysym(A), S, u, Filter, R = FALSE, format = "str")
Expectations(Ryacas::ysym(A), S, u, Filter, R = FALSE, format = "tex")
Expectations(Ryacas::ysym(A), S, u, Filter, R = TRUE)
# Assigning values to symbols
alpha <- 0
beta <- 1
sigmax2 <- 0.25
sigmae2 <- 1
mux <- 0.50
Expectations(Ryacas::ysym(A), S, u, Filter, R = FALSE, format = "ysym")
Expectations(Ryacas::ysym(A), S, u, Filter, R = FALSE, format = "str")
Expectations(Ryacas::ysym(A), S, u, Filter, R = FALSE, format = "tex")
(Expectations <- Expectations(Ryacas::ysym(A), S, u, Filter, R = TRUE))
eval(Expectations$v)
eval(Expectations$g)
eval(Expectations$C)
eval(Expectations$M)
eval(Expectations$C.scaled)
eval(Expectations$M.scaled)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.