| MCPhi | R Documentation |
This function generates random
drift matrices \boldsymbol{\Phi}
using the Monte Carlo method.
MCPhi(phi, vcov_phi_vec, R, test_phi = TRUE, ncores = NULL, seed = NULL)
phi |
Numeric matrix.
The drift matrix ( |
vcov_phi_vec |
Numeric matrix.
The sampling variance-covariance matrix of
|
R |
Positive integer. Number of replications. |
test_phi |
Logical.
If |
ncores |
Positive integer.
Number of cores to use.
If |
seed |
Random seed. |
Let \boldsymbol{\theta} be
\mathrm{vec} \left( \boldsymbol{\Phi} \right),
that is,
the elements of the \boldsymbol{\Phi} matrix
in vector form sorted column-wise.
Let \hat{\boldsymbol{\theta}} be
\mathrm{vec} \left( \hat{\boldsymbol{\Phi}} \right).
Based on the asymptotic properties of maximum likelihood estimators,
we can assume that estimators are normally distributed
around the population parameters.
\hat{\boldsymbol{\theta}}
\sim
\mathcal{N}
\left(
\boldsymbol{\theta},
\mathbb{V} \left( \hat{\boldsymbol{\theta}} \right)
\right)
Using this distributional assumption,
a sampling distribution of \hat{\boldsymbol{\theta}}
which we refer to as \hat{\boldsymbol{\theta}}^{\ast}
can be generated by replacing the population parameters
with sample estimates,
that is,
\hat{\boldsymbol{\theta}}^{\ast}
\sim
\mathcal{N}
\left(
\hat{\boldsymbol{\theta}},
\hat{\mathbb{V}} \left( \hat{\boldsymbol{\theta}} \right)
\right) .
Returns an object
of class ctmedmc which is a list with the following elements:
Function call.
Function arguments.
Function used ("MCPhi").
A list simulated drift matrices.
Ivan Jacob Agaloos Pesigan
Other Continuous Time Mediation Functions:
DeltaBeta(),
DeltaIndirectCentral(),
DeltaMed(),
DeltaTotalCentral(),
Direct(),
Indirect(),
IndirectCentral(),
MCBeta(),
MCIndirectCentral(),
MCMed(),
MCTotalCentral(),
Med(),
PosteriorBeta(),
PosteriorIndirectCentral(),
PosteriorMed(),
PosteriorPhi(),
PosteriorTotalCentral(),
Total(),
TotalCentral(),
Trajectory()
set.seed(42)
phi <- matrix(
data = c(
-0.357, 0.771, -0.450,
0.0, -0.511, 0.729,
0, 0, -0.693
),
nrow = 3
)
colnames(phi) <- rownames(phi) <- c("x", "m", "y")
MCPhi(
phi = phi,
vcov_phi_vec = 0.1 * diag(9),
R = 100L # use a large value for R in actual research
)
phi <- matrix(
data = c(
-6, 5.5, 0, 0,
1.25, -2.5, 5.9, -7.3,
0, 0, -6, 2.5,
5, 0, 0, -6
),
nrow = 4
)
colnames(phi) <- rownames(phi) <- paste0("y", 1:4)
MCPhi(
phi = phi,
vcov_phi_vec = 0.1 * diag(16),
R = 100L, # use a large value for R in actual research
test_phi = FALSE
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.