Skip to content

Commit

Permalink
change DFA vignette back
Browse files Browse the repository at this point in the history
  • Loading branch information
James-Thorson committed Oct 25, 2024
1 parent 8f22ccc commit f2418b3
Showing 1 changed file with 26 additions and 26 deletions.
52 changes: 26 additions & 26 deletions vignettes/dynamic_factor_analysis.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -154,33 +154,33 @@ tsdata = ts( cbind(tsdata, newcols), start=1978)
tsdata = scale( tsdata, center=TRUE, scale=TRUE )
# Automated version
#sem = make_dfa( variables = c("SJI","EBays","SJF","PSnd","HC"),
# n_factors = n_factors )
sem = make_dfa( variables = c("SJI","EBays","SJF","PSnd","HC"),
n_factors = n_factors )
# Manual specification to show structure, using equations-and-lags interface
equations = "
# Loadings of variables onto factors
SJI = L11(0.1) * F1
EBays = L12(0.1) * F1 + L22(0.1) * F2
SJF = L13(0.1) * F1 + L23(0.1) * F2
PSnd = L14(0.1) * F1 + L24(0.1) * F2
HC = L15(0.1) * F1 + L25(0.1) * F2
# random walk for factors
F1 = NA(1) * lag[F1,1]
F2 = NA(1) * lag[F2,1]
# Unit variance for factors
V(F1) = NA(1)
V(F2) = NA(1)
# Zero residual variance for variables
V(SJI) = NA(0)
V(EBays) = NA(0)
V(SJF) = NA(0)
V(PSnd) = NA(0)
V(HC) = NA(0)
"
sem = convert_equations(equations)
#equations = "
# # Loadings of variables onto factors
# SJI = L11(0.1) * F1
# EBays = L12(0.1) * F1 + L22(0.1) * F2
# SJF = L13(0.1) * F1 + L23(0.1) * F2
# PSnd = L14(0.1) * F1 + L24(0.1) * F2
# HC = L15(0.1) * F1 + L25(0.1) * F2
#
# # random walk for factors
# F1 = NA(1) * lag[F1,1]
# F2 = NA(1) * lag[F2,1]
#
# # Unit variance for factors
# V(F1) = NA(1)
# V(F2) = NA(1)
#
# # Zero residual variance for variables
# V(SJI) = NA(0)
# V(EBays) = NA(0)
# V(SJF) = NA(0)
# V(PSnd) = NA(0)
# V(HC) = NA(0)
#"
#sem = convert_equations(equations)
# Initial fit
mydsem0 = dsem( tsdata = tsdata,
Expand Down

0 comments on commit f2418b3

Please sign in to comment.