Title: | Statistical Analysis for Task-Based Fmri Data |
---|---|
Description: | The 'BayesDLMfMRI' package performs statistical analysis for task-based functional magnetic resonance imaging (fMRI) data at both individual and group levels. The analysis to detect brain activation at the individual level is based on modeling the fMRI signal using Matrix-Variate Dynamic Linear Models (MDLM). The analysis for the group stage is based on posterior distributions of the state parameter obtained from the modeling at the individual level. In this way, this package offers several R functions with different algorithms to perform inference on the state parameter to assess brain activation for both individual and group stages. Those functions allow for parallel computation when the analysis is performed for the entire brain as well as analysis at specific voxels when it is required. References: Cardona-Jiménez (2021) <doi:10.1016/j.csda.2021.107297>; Cardona-Jiménez (2021) <arXiv:2111.01318>. |
Authors: | Johnatan Cardona-Jiménez [aut], Carlos Pérez [cre, aut], Isabel Ramírez [aut] |
Maintainer: | Carlos Pérez <[email protected]> |
License: | GPL-2 |
Version: | 0.0.3 |
Built: | 2025-02-14 05:40:49 UTC |
Source: | https://github.com/johnatanlab/bayesdlmfmri |
The 'BayesDLMfMRI' package performs statistical analysis for task-based functional magnetic resonance imaging (fMRI) data at both individual and group levels. The analysis to detect brain activation at the individual level is based on modeling the fMRI signal using Matrix-Variate Dynamic Linear Models (MDLM). The analysis for the group stage is based on posterior distributions of the state parameter obtained from the modeling at the individual level. In this way, this package offers several R functions with different algorithms to perform inference on the state parameter to assess brain activation for both individual and group stages. Those functions allow for parallel computation when the analysis is performed for the entire brain as well as analysis at specific voxels when it is required.
Maintainer: Carlos Peréz [email protected]
Creator: Johnatan Cardona-Jiménez [email protected]
Contributor: Isabel Ramírez [email protected]
Covariates related to the observed BOLD response and its derivative used in the examples presented in the vignettes.
Covariates
Covariates
An object of class data.frame
with 310 rows and 2 columns.
data("covariates", package="BayesDLMfMRI")
data("covariates", package="BayesDLMfMRI")
MNI image used to plot posterior probability maps in the examples presented in the vignettes.
ffd
ffd
An object of class nifti
of dimension 91 x 109 x 91.
data("ffd", package="BayesDLMfMRI")
data("ffd", package="BayesDLMfMRI")
This function can be used to build activation maps for task-based fMRI data.
ffdEvidenceFETS( ffdc, covariates, m0 = 0, Cova = 100, delta = 0.95, S0 = 1, n0 = 1, N1 = FALSE, Nsimu1 = 100, Cutpos1 = 30, r1 = 1, perVol = 0.1, Test = "LTT", Ncores = NULL, seed = NULL )
ffdEvidenceFETS( ffdc, covariates, m0 = 0, Cova = 100, delta = 0.95, S0 = 1, n0 = 1, N1 = FALSE, Nsimu1 = 100, Cutpos1 = 30, r1 = 1, perVol = 0.1, Test = "LTT", Ncores = NULL, seed = NULL )
ffdc |
a 4D array ( |
covariates |
a data frame or matrix whose columns contain the covariates related to the expected BOLD response obtained from the experimental setup. |
m0 |
the constant prior mean value for the covariates parameters and common to all voxels within every neighborhood at |
Cova |
a positive constant that defines the prior variances for the covariates parameters at |
delta |
a discount factor related to the evolution variances. Recommended values between |
S0 |
prior covariance structure among voxels within every cluster at |
n0 |
a positive hyperparameter of the prior distribution for the covariance matrix |
N1 |
is the number of images ( |
Nsimu1 |
is the number of simulated on-line trajectories related to the state parameters. These simulated curves are later employed to compute the posterior probability of voxel activation. |
Cutpos1 |
a cutpoint time from where the on-line trajectories begin. This parameter value is related to an approximation from a t-student distribution to a normal distribution. Values equal to or greater than 30 are recommended ( |
r1 |
a positive integer number that defines the distance from every voxel with its most distant neighbor. This value determines the size of the cluster. The users can set a range of different |
perVol |
helps to define a threshold for the voxels considered in the analysis. For example, |
Test |
test type either |
Ncores |
a positive integer indicating the number of threads or cores to be used in the computation of the activation maps. |
seed |
random seed. |
Every voxel from the 4D array image is clustered with its nearest neighbors. There are as many clusters as voxels in the image. Then, activation maps are obtained by fitting a multivariate dynamic linear model on every cluster of voxels. The resulting activation evidence measure for every voxel is obtained using the Forward Estimated Trajectories Sampler (FETS) algorithm. To deeply understand the method implemented in this package, a reading of (Cardona-Jiménez and de B. Pereira 2021) and (Cardona-Jiménez 2021) is mandatory.
It returns a list of the type res[[p]][x,y,z]
, where p
represents the column position in
the covariates matrix and [x,y,z]
represent the voxel position in the brain image.
Cardona-Jiménez J, de B. Pereira CA (2021). “Assessing dynamic effects on a Bayesian matrix-variate dynamic linear model: An application to task-based fMRI data analysis.” Computational Statistics & Data Analysis, 163, 107297. ISSN 0167-9473, doi:10.1016/j.csda.2021.107297, https://www.sciencedirect.com/science/article/pii/S0167947321001316.
Cardona-Jiménez J (2021). “BayesDLMfMRI: Bayesian Matrix-Variate Dynamic Linear Models for Task-based fMRI Modeling in R.” arXiv e-prints, arXiv–2111.
## Not run: fMRI.data <- get_example_fMRI_data() data("covariates", package="BayesDLMfMRI") res <- ffdEvidenceFETS(ffdc = fMRI.data, covariates = Covariates, m0 = 0, Cova = 100, delta = 0.95, S0 = 1, n0 = 1, Nsimu1 = 100, Cutpos1 = 30, r1 = 2, Test = "JointTest", Ncores = 1) str(res) ## End(Not run)
## Not run: fMRI.data <- get_example_fMRI_data() data("covariates", package="BayesDLMfMRI") res <- ffdEvidenceFETS(ffdc = fMRI.data, covariates = Covariates, m0 = 0, Cova = 100, delta = 0.95, S0 = 1, n0 = 1, Nsimu1 = 100, Cutpos1 = 30, r1 = 2, Test = "JointTest", Ncores = 1) str(res) ## End(Not run)
This function can be used to build activation maps for task-based fMRI data.
ffdEvidenceFFBS( ffdc, covariates, m0 = 0, Cova = 100, delta = 0.95, S0 = 1, n0 = 1, N1 = FALSE, Nsimu1 = 100, Cutpos1 = 30, r1 = 1, perVol = 0.1, Ncores = NULL, seed = NULL )
ffdEvidenceFFBS( ffdc, covariates, m0 = 0, Cova = 100, delta = 0.95, S0 = 1, n0 = 1, N1 = FALSE, Nsimu1 = 100, Cutpos1 = 30, r1 = 1, perVol = 0.1, Ncores = NULL, seed = NULL )
ffdc |
a 4D array ( |
covariates |
a data frame or matrix whose columns contain the covariates related to the expected BOLD response obtained from the experimental setup. |
m0 |
the constant prior mean value for the covariates parameters and common to all voxels within every neighborhood at |
Cova |
a positive constant that defines the prior variances for the covariates parameters at |
delta |
a discount factor related to the evolution variances. Recommended values between |
S0 |
prior covariance structure among voxels within every cluster at |
n0 |
a positive hyperparameter of the prior distribution for the covariance matrix |
N1 |
is the number of images ( |
Nsimu1 |
is the number of simulated on-line trajectories related to the state parameters. These simulated curves are later employed to compute the posterior probability of voxel activation. |
Cutpos1 |
a cutpoint time from where the on-line trajectories begin. This parameter value is related to an approximation from a t-student distribution to a normal distribution. Values equal to or greater than 30 are recommended ( |
r1 |
a positive integer number that defines the distance from every voxel with its most distant neighbor. This value determines the size of the cluster. The users can set a range of different |
perVol |
helps to define a threshold for the voxels considered in the analysis. For example, |
Ncores |
a postive integer indicating the number of threads or cores to be used in the computation of the activation maps. |
seed |
random seed. |
Every voxel from the 4D array image is clustered with its nearest neighbors. There are as many clusters as voxels in the image. Then, activation maps are obtained by fitting a multivariate dynamic linear model on every cluster of voxels. The resulting activation evidence measure for every voxel is obtained by using the Forward filtering backward sampling (FFBS) algorithm. To deeply understand the method implemented in this package, a reading of (Cardona-Jiménez and de B. Pereira 2021) and (Cardona-Jiménez 2021) is mandatory.
It returns a list of the form res[[k]][p,x,y,z]
, where k
defines the type of test (k = 1
for "Marginal"
, k = 2
for "JointTest"
, and k = 3
for "LTT"
), p
represents the column position in the covariates matrix and x,y,z
represent the voxel position in the brain image.
Cardona-Jiménez J, de B. Pereira CA (2021). “Assessing dynamic effects on a Bayesian matrix-variate dynamic linear model: An application to task-based fMRI data analysis.” Computational Statistics & Data Analysis, 163, 107297. ISSN 0167-9473, doi:10.1016/j.csda.2021.107297, https://www.sciencedirect.com/science/article/pii/S0167947321001316.
Cardona-Jiménez J (2021). “BayesDLMfMRI: Bayesian Matrix-Variate Dynamic Linear Models for Task-based fMRI Modeling in R.” arXiv e-prints, arXiv–2111.
## Not run: fMRI.data <- get_example_fMRI_data() data("covariates", package="BayesDLMfMRI") res <- ffdEvidenceFFBS(ffdc = fMRI.data, covariates = Covariates, m0=0, Cova=100, delta=0.95, S0=1, n0=1, N1=FALSE, Nsimu1 = 100, Cutpos1=30, r1 = 1, perVol = 0.10, Ncores=3) str(res) ## End(Not run)
## Not run: fMRI.data <- get_example_fMRI_data() data("covariates", package="BayesDLMfMRI") res <- ffdEvidenceFFBS(ffdc = fMRI.data, covariates = Covariates, m0=0, Cova=100, delta=0.95, S0=1, n0=1, N1=FALSE, Nsimu1 = 100, Cutpos1=30, r1 = 1, perVol = 0.10, Ncores=3) str(res) ## End(Not run)
This function can be used to build activation maps for task-based fMRI data.
ffdEvidenceFSTS( ffdc, covariates, m0 = 0, Cova = 100, delta = 0.95, S0 = 1, n0 = 1, N1 = FALSE, Nsimu1 = 100, Cutpos1 = 30, r1 = 1, perVol = 0.1, Ncores = NULL, seed = NULL )
ffdEvidenceFSTS( ffdc, covariates, m0 = 0, Cova = 100, delta = 0.95, S0 = 1, n0 = 1, N1 = FALSE, Nsimu1 = 100, Cutpos1 = 30, r1 = 1, perVol = 0.1, Ncores = NULL, seed = NULL )
ffdc |
a 4D array ( |
covariates |
a data frame or matrix whose columns contain the covariates related to the expected BOLD response obtained from the experimental setup. |
m0 |
the constant prior mean value for the covariates parameters and common to all voxels within every neighborhood at |
Cova |
a positive constant that defines the prior variances for the covariates parameters at |
delta |
a discount factor related to the evolution variances. Recommended values between |
S0 |
prior covariance structure among voxels within every cluster at |
n0 |
a positive hyperparameter of the prior distribution for the covariance matrix |
N1 |
is the number of images ( |
Nsimu1 |
is the number of simulated on-line trajectories related to the state parameters. These simulated curves are later employed to compute the posterior probability of voxel activation. |
Cutpos1 |
a cutpoint time from where the on-line trajectories begin. This parameter value is related to an approximation from a t-student distribution to a normal distribution. Values equal to or greater than 30 are recommended ( |
r1 |
a positive integer number that defines the distance from every voxel with its most distant neighbor. This value determines the size of the cluster. The users can set a range of different |
perVol |
helps to define a threshold for the voxels considered in the analysis. For example, |
Ncores |
a positive integer indicating the number of threads or cores to be used in the computation of the activation maps. |
seed |
random seed. |
Every voxel from the 4D array image is clustered with its nearest neighbors. There are as many clusters as voxels in the image. Then, activation maps are obtained by fitting a multivariate dynamic linear model on every cluster of voxels. The resulting activation evidence measure for every voxel is obtained by using the Forward State Trajectories Sampler (FSTS) algorithm. To deeply understand the method implemented in this package, a reading of (Cardona-Jiménez and de B. Pereira 2021) and (Cardona-Jiménez 2021) is mandatory.
It returns a list of the form [[k]][p,x,y,z]
, where k defines the type of test (k = 1
for "Marginal"
, k = 2
for "JointTest"
, and k = 3
for "LTT"
), p
represents the column position in the covariates matrix and x,y,z
represent the voxel position in the brain image.
Cardona-Jiménez J, de B. Pereira CA (2021). “Assessing dynamic effects on a Bayesian matrix-variate dynamic linear model: An application to task-based fMRI data analysis.” Computational Statistics & Data Analysis, 163, 107297. ISSN 0167-9473, doi:10.1016/j.csda.2021.107297, https://www.sciencedirect.com/science/article/pii/S0167947321001316.
Cardona-Jiménez J (2021). “BayesDLMfMRI: Bayesian Matrix-Variate Dynamic Linear Models for Task-based fMRI Modeling in R.” arXiv e-prints, arXiv–2111.
## Not run: fMRI.data <- get_example_fMRI_data() data("covariates", package="BayesDLMfMRI") res <- ffdEvidenceFSTS(ffdc = fMRI.data, covariates = Covariates, m0=0, Cova=100, delta=0.95, S0=1, n0=1, N1=FALSE, Nsimu1 = 100, Cutpos1=30, r1 = 1, perVol = 0.10, Ncores=3) str(res) ## End(Not run)
## Not run: fMRI.data <- get_example_fMRI_data() data("covariates", package="BayesDLMfMRI") res <- ffdEvidenceFSTS(ffdc = fMRI.data, covariates = Covariates, m0=0, Cova=100, delta=0.95, S0=1, n0=1, N1=FALSE, Nsimu1 = 100, Cutpos1=30, r1 = 1, perVol = 0.10, Ncores=3) str(res) ## End(Not run)
This function can be used to build activation maps for group task-based fMRI data.
ffdGroupEvidenceFETS( ffdGroup, covariates, m0 = 0, Cova = 100, delta = 0.95, S0 = 1, n0 = 1, N1 = FALSE, Nsimu1 = 100, Cutpos = 30, r1, Test, mask, Ncores = NULL )
ffdGroupEvidenceFETS( ffdGroup, covariates, m0 = 0, Cova = 100, delta = 0.95, S0 = 1, n0 = 1, N1 = FALSE, Nsimu1 = 100, Cutpos = 30, r1, Test, mask, Ncores = NULL )
ffdGroup |
list of N elements, each being a 4D array ( |
covariates |
a data frame or matrix whose columns contain the covariates related to the expected BOLD response obtained from the experimental setup. |
m0 |
the constant prior mean value for the covariates parameters and common to all voxels within every neighborhood at |
Cova |
a positive constant that defines the prior variances for the covariates parameters at |
delta |
a discount factor related to the evolution variances. Recommended values between |
S0 |
prior covariance structure between pair of voxels within every cluster at |
n0 |
a positive hyperparameter of the prior distribution for the covariance matrix |
N1 |
is the number of images ( |
Nsimu1 |
is the number of simulated on-line trajectories related to the state parameters. These simulated curves are later employed to compute the posterior probability of voxel activation. |
Cutpos |
a cutpoint time from where the on-line trajectories begin. This parameter value is related to an approximation from a t-student distribution to a normal distribution. Values equal to or greater than 30 are recommended ( |
r1 |
positive integer number that defines the distance from every voxel with its most distant neighbor. This value determines the size of the cluster. The users can set a range of different |
Test |
test type either |
mask |
a 3D array that works as a brain of reference (MNI atlas) for the group analysis. |
Ncores |
a positive integer indicating the number of threads or cores to be used in the computation of the activation maps. |
A multivariate dynamic linear model is fitted in the same fashion as at the individual level for every subject in the sample. However, at this stage, the posterior distributions from all the subjects are combined to build a single one, which is then employed to compute the activation evidence maps for the group using Forward estimated trajectories sampler (FETS) algorithm. To deeply understand the method implemented in this package, a reading of (Cardona-Jiménez and de B. Pereira 2021) and (Cardona-Jiménez 2021) is mandatory.
It returns a list of \(2 \times p\) elements, where \(p\) is the number of covariates, and 2 is the number
of options evaluated as sampler distributions: Average cluster effect and Marginal effect (when Test=="LTT"
) or Joint effect and Marginal effect (when Test=="JointTest"
). The first p
elements from the list are
the activation maps related to each column of the covariates matrix respectively when computing the activation evidence using either
Test=="LTT"
or Test=="JointTest"
. The remaining activation maps are those associated with the marginal distribution.
Cardona-Jiménez J, de B. Pereira CA (2021). “Assessing dynamic effects on a Bayesian matrix-variate dynamic linear model: An application to task-based fMRI data analysis.” Computational Statistics & Data Analysis, 163, 107297. ISSN 0167-9473, doi:10.1016/j.csda.2021.107297, https://www.sciencedirect.com/science/article/pii/S0167947321001316.
Cardona-Jiménez J (2021). “BayesDLMfMRI: Bayesian Matrix-Variate Dynamic Linear Models for Task-based fMRI Modeling in R.” arXiv e-prints, arXiv–2111.
## Not run: DatabaseGroup <- get_example_fMRI_data_group() data("covariates", package="BayesDLMfMRI") data("mask", package="BayesDLMfMRI") res <- ffdGroupEvidenceFETS(ffdGroup = DatabaseGroup, covariates = Covariates, m0 = 0, Cova = 100, delta = 0.95, S0 = 1, n0 = 1, N1 = FALSE, Nsimu1 = 100, Cutpos=30, r1 = 1, Test = "JointTest", mask = mask, Ncores = 7) str(res) ## End(Not run)
## Not run: DatabaseGroup <- get_example_fMRI_data_group() data("covariates", package="BayesDLMfMRI") data("mask", package="BayesDLMfMRI") res <- ffdGroupEvidenceFETS(ffdGroup = DatabaseGroup, covariates = Covariates, m0 = 0, Cova = 100, delta = 0.95, S0 = 1, n0 = 1, N1 = FALSE, Nsimu1 = 100, Cutpos=30, r1 = 1, Test = "JointTest", mask = mask, Ncores = 7) str(res) ## End(Not run)
This function can be used to build activation maps for group task-based fMRI data.
ffdGroupEvidenceFFBS( ffdGroup, covariates, m0 = 0, Cova = 100, delta = 0.95, S0 = 1, n0 = 1, N1 = FALSE, Nsimu1 = 100, Cutpos = 30, r1, mask, Ncores = NULL )
ffdGroupEvidenceFFBS( ffdGroup, covariates, m0 = 0, Cova = 100, delta = 0.95, S0 = 1, n0 = 1, N1 = FALSE, Nsimu1 = 100, Cutpos = 30, r1, mask, Ncores = NULL )
ffdGroup |
list of N elements, each being a 4D array ( |
covariates |
a data frame or matrix whose columns contain the covariates related to the expected BOLD response obtained from the experimental setup |
m0 |
the constant prior mean value for the covariates parameters and common to all voxels within every neighborhood at |
Cova |
a positive constant that defines the prior variances for the covariates parameters at |
delta |
a discount factor related to the evolution variances. Recommended values between |
S0 |
prior covariance structure between pair of voxels within every cluster at |
n0 |
a positive hyperparameter of the prior distribution for the covariance matrix |
N1 |
is the number of images ( |
Nsimu1 |
is the number of simulated on-line trajectories related to the state parameters. These simulated curves are later employed to compute the posterior probability of voxel activation. |
Cutpos |
a cutpoint time from where the on-line trajectories begin. This parameter value is related to an approximation from a t-student distribution to a normal distribution. Values equal to or greater than 30 are recommended ( |
r1 |
positive integer number that defines the distance from every voxel with its most distant neighbor. This value determines the size of the cluster. The users can set a range of different |
mask |
a 3D array that works as a brain of reference (MNI atlas) for the group analysis. |
Ncores |
a postive integer indicating the number of threads or cores to be used in the computation of the activation maps. |
A multivariate dynamic linear model is fitted in the same fashion as at the individual level for every subject in the sample. However, at this stage, the posterior distributions from all the subjects are combined to build a single one, which is then employed to compute the activation evidence maps for the group using the Forward Filtering Backward Sampling (FFBS) algorithm. To deeply understand the method implemented in this package, a reading of (Cardona-Jiménez and de B. Pereira 2021) and (Cardona-Jiménez 2021) is mandatory.
It returns a list of the form [[k]][p,x,y,z]
, where k defines the type of test
(k = 1
for Marginal effect, k = 2
for Joint effect, and k = 3
for Average cluster effect), p
represents the column
position in the covariates matrix and x,y,z
represent the voxel position in the brain image.
Cardona-Jiménez J, de B. Pereira CA (2021). “Assessing dynamic effects on a Bayesian matrix-variate dynamic linear model: An application to task-based fMRI data analysis.” Computational Statistics & Data Analysis, 163, 107297. ISSN 0167-9473, doi:10.1016/j.csda.2021.107297, https://www.sciencedirect.com/science/article/pii/S0167947321001316.
Cardona-Jiménez J (2021). “BayesDLMfMRI: Bayesian Matrix-Variate Dynamic Linear Models for Task-based fMRI Modeling in R.” arXiv e-prints, arXiv–2111.
## Not run: # This example can take a long time to run. DatabaseGroup <- get_example_fMRI_data_group() data("covariates", package="BayesDLMfMRI") res <- ffdGroupEvidenceFFBS(ffdGroup = DatabaseGroup, covariates = Covariates, m0=0, Cova=100, delta = 0.95, S0 = 1, n0 = 1, N1 = FALSE, Nsimu1 = 100, Cutpos = 30, r1 = 1, mask = MASK, Ncores = 7) str(res) ## End(Not run)
## Not run: # This example can take a long time to run. DatabaseGroup <- get_example_fMRI_data_group() data("covariates", package="BayesDLMfMRI") res <- ffdGroupEvidenceFFBS(ffdGroup = DatabaseGroup, covariates = Covariates, m0=0, Cova=100, delta = 0.95, S0 = 1, n0 = 1, N1 = FALSE, Nsimu1 = 100, Cutpos = 30, r1 = 1, mask = MASK, Ncores = 7) str(res) ## End(Not run)
This function can be used to build activation maps for group task-based fMRI data.
ffdGroupEvidenceFSTS( ffdGroup, covariates, m0 = 0, Cova = 100, delta = 0.95, S0 = 1, n0 = 1, N1 = FALSE, Nsimu1 = 100, Cutpos = 30, r1, mask, Ncores = NULL )
ffdGroupEvidenceFSTS( ffdGroup, covariates, m0 = 0, Cova = 100, delta = 0.95, S0 = 1, n0 = 1, N1 = FALSE, Nsimu1 = 100, Cutpos = 30, r1, mask, Ncores = NULL )
ffdGroup |
list of N elements, each being a 4D array ( |
covariates |
a data frame or matrix whose columns contain the covariates related to the expected BOLD response obtained from the experimental setup |
m0 |
the constant prior mean value for the covariates parameters and common to all voxels within every neighborhood at |
Cova |
a positive constant that defines the prior variances for the covariates parameters at |
delta |
a discount factor related to the evolution variances. Recommended values between |
S0 |
prior covariance structure between pair of voxels within every cluster at |
n0 |
a positive hyperparameter of the prior distribution for the covariance matrix |
N1 |
is the number of images ( |
Nsimu1 |
is the number of simulated on-line trajectories related to the state parameters. These simulated curves are later employed to compute the posterior probability of voxel activation. |
Cutpos |
a cutpoint time from where the on-line trajectories begin. This parameter value is related to an approximation from a t-student distribution to a normal distribution. Values equal to or greater than 30 are recommended ( |
r1 |
a positive integer number that defines the distance from every voxel with its most distant neighbor. This value determines the size of the cluster. The users can set a range of different |
mask |
3D array that works as a brain of reference (MNI atlas) for the group analysis. |
Ncores |
a postive integer indicating the number of threads or cores to be used in the computation of the activation maps. |
A multivariate dynamic linear model is fitted in the same fashion as at the individual level for every subject in the sample. However, at this stage, the posterior distributions from all the subjects are combined to build a single one, which is then employed to compute the activation evidence maps for the group using the Forward State Trajectories Sampler (FSTS) algorithm To deeply understand the method implemented in this package, a reading of (Cardona-Jiménez and de B. Pereira 2021) and (Cardona-Jiménez 2021) is mandatory.
It returns a list of the form [[k]][p,x,y,z]
, where k
defines the type of test
(k = 1
for Marginal effect, k = 2
for Joint effect, and k = 3
for Average cluster effect), p
represents the column
position in the covariates matrix and x,y,z
represent the voxel position in the brain image.
## Not run: # This example can take a long time to run. DatabaseGroup <- get_example_fMRI_data_group() data("covariates", package="BayesDLMfMRI") res <- ffdGroupEvidenceFSTS(ffdGroup = DatabaseGroup, covariates = Covariates, m0 = 0, Cova = 100, delta = 0.95, S0 = 1, n0 = 1, N1 = FALSE, Nsimu1 = 100, Cutpos=30, r1 = 1, mask = MASK, Ncores = 7) str(res) ## End(Not run)
## Not run: # This example can take a long time to run. DatabaseGroup <- get_example_fMRI_data_group() data("covariates", package="BayesDLMfMRI") res <- ffdGroupEvidenceFSTS(ffdGroup = DatabaseGroup, covariates = Covariates, m0 = 0, Cova = 100, delta = 0.95, S0 = 1, n0 = 1, N1 = FALSE, Nsimu1 = 100, Cutpos=30, r1 = 1, mask = MASK, Ncores = 7) str(res) ## End(Not run)
This function is used to download the example data used in the Vignettes.
get_example_fMRI_data(save_path = NULL, force = FALSE, subject = 1)
get_example_fMRI_data(save_path = NULL, force = FALSE, subject = 1)
save_path |
location where the data the example data is stored. |
force |
force the download, even if the data already exists. |
subject |
The example subject, must be 1 or 2. |
The data for this example is related to an fMRI experiment where a sound stimulus is presented. That experiment is intended to offer a "voice localizer" scan, which allows rapid and reliable localization of the voice-sensitive "temporal voice areas" (TVA) of the human auditory cortex (Pernet et al. 2015). The data of this "voice localizer" scan is freely available on the online platform OpenNEURO (Gorgolewski et al. 2017).
It returns an array of dimensions [91, 109, 91, 310]
.
Pernet CR, McAleer P, Latinus M, Gorgolewski KJ, Charest I, Bestelmeyer PE, Watson RH, Fleming D, Crabbe F, Valdes-Sosa M, others (2015). “The human voice areas: Spatial organization and inter-individual variability in temporal and extra-temporal cortices.” Neuroimage, 119, 164–174.
Gorgolewski K, Esteban O, Schaefer G, Wandell B, Poldrack R (2017). “OpenNeuro - a free online platform for sharing and analysis of neuroimaging data.” Organization for Human Brain Mapping. Vancouver, Canada, 1677.
## Not run: # This example can take a long time to run. fMRI.data <- get_example_fMRI_data() ## End(Not run)
## Not run: # This example can take a long time to run. fMRI.data <- get_example_fMRI_data() ## End(Not run)
This function is used to download the example data used in the Vignettes.
get_example_fMRI_data_group(save_path = NULL, force = FALSE)
get_example_fMRI_data_group(save_path = NULL, force = FALSE)
save_path |
location where the data the example data is stored. |
force |
force the download, even if the data already exists. |
The data for this example is related to an fMRI experiment where a sound stimulus is presented. That experiment is intended to offer a "voice localizer" scan, which allows rapid and reliable localization of the voice-sensitive "temporal voice areas" (TVA) of the human auditory cortex (Pernet et al. 2015). The data of this "voice localizer" scan is freely available on the online platform OpenNEURO (Gorgolewski et al. 2017).
It returns a list in which each element is an array of dimensions [91, 109, 91, 310]
.
Pernet CR, McAleer P, Latinus M, Gorgolewski KJ, Charest I, Bestelmeyer PE, Watson RH, Fleming D, Crabbe F, Valdes-Sosa M, others (2015). “The human voice areas: Spatial organization and inter-individual variability in temporal and extra-temporal cortices.” Neuroimage, 119, 164–174.
Gorgolewski K, Esteban O, Schaefer G, Wandell B, Poldrack R (2017). “OpenNeuro - a free online platform for sharing and analysis of neuroimaging data.” Organization for Human Brain Mapping. Vancouver, Canada, 1677.
## Not run: # This example can take a long time to run. DatabaseGroup <- get_example_fMRI_data_group() ## End(Not run)
## Not run: # This example can take a long time to run. DatabaseGroup <- get_example_fMRI_data_group() ## End(Not run)
This function is used to perform a group activation analysis for single voxels based on the FETS algorithm.
GroupSingleVoxelFETS( posi.ffd, DatabaseGroup, covariates, m0, Cova, delta, S0, n0, N1, Nsimu1, r1, Test, Cutpos )
GroupSingleVoxelFETS( posi.ffd, DatabaseGroup, covariates, m0, Cova, delta, S0, n0, N1, Nsimu1, r1, Test, Cutpos )
posi.ffd |
the position of the voxel in the brain image. |
DatabaseGroup |
list of N elements, each being a 4D array ( |
covariates |
a data frame or matrix whose columns contain the covariates related to the expected BOLD response obtained from the experimental setup. |
m0 |
the constant prior mean value for the covariates parameters and common to all voxels within every neighborhood at |
Cova |
a positive constant that defines the prior variances for the covariates parameters at |
delta |
a discount factor related to the evolution variances. Recommended values between |
S0 |
prior covariance structure between pair of voxels within every cluster at |
n0 |
a positive hyperparameter of the prior distribution for the covariance matrix |
N1 |
is the number of images ( |
Nsimu1 |
is the number of simulated on-line trajectories related to the state parameters. These simulated curves are later employed to compute the posterior probability of voxel activation. |
r1 |
a positive integer number that defines the distance from every voxel with its most distant neighbor. This value determines the size of the cluster. The users can set a range of different |
Test |
test type either |
Cutpos |
a cutpoint time from where the on-line trajectories begin. This parameter value is related to an approximation from a t-student distribution to a normal distribution. Values equal to or greater than 30 are recommended ( |
This function allows the performance of a group activation analysis for single voxels. A multivariate dynamic linear model is fitted to a cluster of voxels, with its center at location (i,j,k)
, in the way it is presented in (Cardona-Jiménez and de B. Pereira 2021).
a list containing a vector (Evidence) with the evidence measure of
activation for each of the p
covariates considered in the model, the simulated
online trajectories related to the state parameter, the simulated BOLD responses, \(\hat{Y}\)ascii.
and a measure to examine the goodness of fit of the model \((100 \ast |Y[i,j,k]_t - \hat{Y}[i,j,k]_t | \hat{Y}[i,j,k]_t )\) for that particular voxel (FitnessV
).
Cardona-Jiménez J, de B. Pereira CA (2021). “Assessing dynamic effects on a Bayesian matrix-variate dynamic linear model: An application to task-based fMRI data analysis.” Computational Statistics & Data Analysis, 163, 107297. ISSN 0167-9473, doi:10.1016/j.csda.2021.107297, https://www.sciencedirect.com/science/article/pii/S0167947321001316.
Cardona-Jiménez J (2021). “BayesDLMfMRI: Bayesian Matrix-Variate Dynamic Linear Models for Task-based fMRI Modeling in R.” arXiv e-prints, arXiv–2111.
## Not run: # This example can take a long time to run. DatabaseGroup <- get_example_fMRI_data_group() data("covariates", package="BayesDLMfMRI") resSingle <- GroupSingleVoxelFETS(posi.ffd = c(14, 56, 40), DatabaseGroup, covariates = Covariates, m0 = 0, Cova = 100, delta = 0.95, S0 = 1, n0 = 1, N1 = FALSE, Nsimu1 = 100, r1 = 1, Test = "JointTest", Cutpos = 30) ## End(Not run)
## Not run: # This example can take a long time to run. DatabaseGroup <- get_example_fMRI_data_group() data("covariates", package="BayesDLMfMRI") resSingle <- GroupSingleVoxelFETS(posi.ffd = c(14, 56, 40), DatabaseGroup, covariates = Covariates, m0 = 0, Cova = 100, delta = 0.95, S0 = 1, n0 = 1, N1 = FALSE, Nsimu1 = 100, r1 = 1, Test = "JointTest", Cutpos = 30) ## End(Not run)
This function is used to perform a group activation analysis for single voxels based on the FFBS algorithm.
GroupSingleVoxelFFBS( posi.ffd, DatabaseGroup, covariates, m0, Cova, delta, S0, n0, N1, Nsimu1, r1, Cutpos )
GroupSingleVoxelFFBS( posi.ffd, DatabaseGroup, covariates, m0, Cova, delta, S0, n0, N1, Nsimu1, r1, Cutpos )
posi.ffd |
the position of the voxel in the brain image. |
DatabaseGroup |
list of N elements, each being a 4D array ( |
covariates |
a data frame or matrix whose columns contain the covariates related to the expected BOLD response obtained from the experimental setup. |
m0 |
the constant prior mean value for the covariates parameters and common to all voxels within every neighborhood at |
Cova |
a positive constant that defines the prior variances for the covariates parameters at |
delta |
a discount factor related to the evolution variances. Recommended values between |
S0 |
prior covariance structure between pair of voxels within every cluster at |
n0 |
a positive hyperparameter of the prior distribution for the covariance matrix |
N1 |
is the number of images ( |
Nsimu1 |
is the number of simulated on-line trajectories related to the state parameters. These simulated curves are later employed to compute the posterior probability of voxel activation. |
r1 |
a positive integer number that defines the distance from every voxel with its most distant neighbor. This value determines the size of the cluster. The users can set a range of different |
Cutpos |
a cutpoint time from where the on-line trajectories begin. This parameter value is related to an approximation from a t-student distribution to a normal distribution. Values equal to or greater than 30 are recommended ( |
This function allows the performance of a group activation analysis for single voxels. A multivariate dynamic linear model is fitted to a cluster of voxels, with its center at location (i,j,k), in the way it is presented in (Cardona-Jiménez and de B. Pereira 2021).
a list containing a vector (Evidence
) with the evidence measure of
activation for each of the p
covariates considered in the model, the simulated
online trajectories related to the state parameter, the simulated BOLD responses,
and a measure to examine the goodness of fit of the model \((100 \ast |Y[i,j,k]_t - \hat{Y}[i,j,k]_t |/ \hat{Y}[i,j,k]_t )\) for that particular voxel (FitnessV
).
Cardona-Jiménez J, de B. Pereira CA (2021). “Assessing dynamic effects on a Bayesian matrix-variate dynamic linear model: An application to task-based fMRI data analysis.” Computational Statistics & Data Analysis, 163, 107297. ISSN 0167-9473, doi:10.1016/j.csda.2021.107297, https://www.sciencedirect.com/science/article/pii/S0167947321001316.
Cardona-Jiménez J (2021). “BayesDLMfMRI: Bayesian Matrix-Variate Dynamic Linear Models for Task-based fMRI Modeling in R.” arXiv e-prints, arXiv–2111.
## Not run: # This example can take a long time to run. DatabaseGroup <- get_example_fMRI_data_group() data("covariates", package="BayesDLMfMRI") resSingle <- GroupSingleVoxelFFBS(posi.ffd = c(14, 56, 40), DatabaseGroup, covariates = Covariates, m0 = 0, Cova = 100, delta = 0.95, S0 = 1, n0 = 1, N1 = FALSE, Nsimu1 = 100, r1 = 1, Cutpos = 30) ## End(Not run)
## Not run: # This example can take a long time to run. DatabaseGroup <- get_example_fMRI_data_group() data("covariates", package="BayesDLMfMRI") resSingle <- GroupSingleVoxelFFBS(posi.ffd = c(14, 56, 40), DatabaseGroup, covariates = Covariates, m0 = 0, Cova = 100, delta = 0.95, S0 = 1, n0 = 1, N1 = FALSE, Nsimu1 = 100, r1 = 1, Cutpos = 30) ## End(Not run)
This function is used to perform a group activation analysis for single voxels based on the FSTS algorithm.
GroupSingleVoxelFSTS( posi.ffd, DatabaseGroup, covariates, m0, Cova, delta, S0, n0, N1, Nsimu1, r1, Cutpos )
GroupSingleVoxelFSTS( posi.ffd, DatabaseGroup, covariates, m0, Cova, delta, S0, n0, N1, Nsimu1, r1, Cutpos )
posi.ffd |
the position of the voxel in the brain image. |
DatabaseGroup |
list of N elements, each being a 4D array ( |
covariates |
a data frame or matrix whose columns contain the covariates related to the expected BOLD response obtained from the experimental setup. |
m0 |
the constant prior mean value for the covariates parameters and common to all voxels within every neighborhood at |
Cova |
a positive constant that defines the prior variances for the covariates parameters at |
delta |
a discount factor related to the evolution variances. Recommended values between |
S0 |
prior covariance structure between pair of voxels within every cluster at |
n0 |
a positive hyperparameter of the prior distribution for the covariance matrix |
N1 |
is the number of images ( |
Nsimu1 |
is the number of simulated on-line trajectories related to the state parameters. These simulated curves are later employed to compute the posterior probability of voxel activation. |
r1 |
a positive integer number that defines the distance from every voxel with its most distant neighbor. This value determines the size of the cluster. The users can set a range of different |
Cutpos |
a cutpoint time from where the on-line trajectories begin. This parameter value is related to an approximation from a t-student distribution to a normal distribution. Values equal to or greater than 30 are recommended ( |
This function allows the performance of a group activation analysis for single voxels. A multivariate dynamic linear model is fitted to a cluster of voxels, with its center at location (i,j,k), in the way it is presented in (Cardona-Jiménez and de B. Pereira 2021).
a list containing a vector (Evidence
) with the evidence measure of
activation for each of the p
covariates considered in the model, the simulated
online trajectories related to the state parameter, the simulated BOLD responses,
and a measure to examine the goodness of fit of the model \((100 \ast |Y[i,j,k]_t - \hat{Y}[i,j,k]_t |/ \hat{Y}[i,j,k]_t )\) for that particular voxel (FitnessV
).
Cardona-Jiménez J, de B. Pereira CA (2021). “Assessing dynamic effects on a Bayesian matrix-variate dynamic linear model: An application to task-based fMRI data analysis.” Computational Statistics & Data Analysis, 163, 107297. ISSN 0167-9473, doi:10.1016/j.csda.2021.107297, https://www.sciencedirect.com/science/article/pii/S0167947321001316.
Cardona-Jiménez J (2021). “BayesDLMfMRI: Bayesian Matrix-Variate Dynamic Linear Models for Task-based fMRI Modeling in R.” arXiv e-prints, arXiv–2111.
## Not run: # This example can take a long time to run. DatabaseGroup <- get_example_fMRI_data_group() data("covariates", package="BayesDLMfMRI") resSingle <- GroupSingleVoxelFSTS(posi.ffd = c(14, 56, 40), DatabaseGroup, covariates = Covariates, m0 = 0, Cova = 100, delta = 0.95, S0 = 1, n0 = 1, N1 = FALSE, Nsimu1 = 100, r1 = 1, Cutpos = 30) ## End(Not run)
## Not run: # This example can take a long time to run. DatabaseGroup <- get_example_fMRI_data_group() data("covariates", package="BayesDLMfMRI") resSingle <- GroupSingleVoxelFSTS(posi.ffd = c(14, 56, 40), DatabaseGroup, covariates = Covariates, m0 = 0, Cova = 100, delta = 0.95, S0 = 1, n0 = 1, N1 = FALSE, Nsimu1 = 100, r1 = 1, Cutpos = 30) ## End(Not run)
A 3D array that works as a brain of reference (MNI atlas) for the group analysis.
mask
mask
An object of class nifti
of dimension 91 x 109 x 91.
data("mask", package="BayesDLMfMRI")
data("mask", package="BayesDLMfMRI")
Plot function
## S3 method for class 'fMRI_single_evidence' plot(x, overlay, index, index2 = NULL, ...)
## S3 method for class 'fMRI_single_evidence' plot(x, overlay, index, index2 = NULL, ...)
x |
is the returned value of any of the ffdEvidence* functions. |
overlay |
MNI image used to plot posterior probability maps. |
index |
the element of |
index2 |
the element of |
... |
additional parameters passed to the |
Plot function
## Not run: fMRI.data <- get_example_fMRI_data() data("covariates", package="BayesDLMfMRI") data("ffd", package="BayesDLMfMRI") # used for overlay. res <- ffdEvidenceFETS(ffdc = fMRI.data, covariates = Covariates, m0 = 0, Cova = 100, delta = 0.95, S0 = 1, n0 = 1, Nsimu1 = 100, Cutpos1 = 30, r1 = 1, Test = "LTT", Ncores = 15) plot(res, overlay=ffd, index=1, col.y = heat.colors(50), ycolorbar = TRUE, ybreaks = seq(0.95, 1, by = 0.001)) ## End(Not run)
## Not run: fMRI.data <- get_example_fMRI_data() data("covariates", package="BayesDLMfMRI") data("ffd", package="BayesDLMfMRI") # used for overlay. res <- ffdEvidenceFETS(ffdc = fMRI.data, covariates = Covariates, m0 = 0, Cova = 100, delta = 0.95, S0 = 1, n0 = 1, Nsimu1 = 100, Cutpos1 = 30, r1 = 1, Test = "LTT", Ncores = 15) plot(res, overlay=ffd, index=1, col.y = heat.colors(50), ycolorbar = TRUE, ybreaks = seq(0.95, 1, by = 0.001)) ## End(Not run)
Print the structure of the object related to the ffdGroupEvidence* functions.
## S3 method for class 'fMRI_group_evidence' print(x, ...)
## S3 method for class 'fMRI_group_evidence' print(x, ...)
x |
is the returned value of any of the ffdGroupEvidence* functions |
... |
Other potential arguments |
Print the structure of the object related to the ffdGroupEvidence* functions.
## Not run: DatabaseGroup <- get_example_fMRI_data_group() data("covariates", package="BayesDLMfMRI") data("mask", package="BayesDLMfMRI") res <- ffdGroupEvidenceFETS(ffdGroup = DatabaseGroup, covariates = Covariates, m0 = 0, Cova = 100, delta = 0.95, S0 = 1, n0 = 1, N1 = FALSE, Nsimu1 = 100, Cutpos=30, r1 = 1, Test = "JointTest", mask = mask, Ncores = 7) print(res) ## End(Not run)
## Not run: DatabaseGroup <- get_example_fMRI_data_group() data("covariates", package="BayesDLMfMRI") data("mask", package="BayesDLMfMRI") res <- ffdGroupEvidenceFETS(ffdGroup = DatabaseGroup, covariates = Covariates, m0 = 0, Cova = 100, delta = 0.95, S0 = 1, n0 = 1, N1 = FALSE, Nsimu1 = 100, Cutpos=30, r1 = 1, Test = "JointTest", mask = mask, Ncores = 7) print(res) ## End(Not run)
Print the structure of the object related to the SingleVoxel* functions.
## S3 method for class 'fMRI_group_single_voxel' print(x, ...)
## S3 method for class 'fMRI_group_single_voxel' print(x, ...)
x |
is the returned value of any of the GroupSingleVoxel* functions |
... |
Other potential arguments |
Print the structure of the object related to the GroupSingleVoxel* functions.
## Not run: DatabaseGroup <- get_example_fMRI_data_group() data("covariates", package="BayesDLMfMRI") res <- GroupSingleVoxelFFBS(posi.ffd = c(14, 56, 40), DatabaseGroup, covariates = Covariates, m0 = 0, Cova = 100, delta = 0.95, S0 = 1, n0 = 1, N1 = FALSE, Nsimu1 = 100, r1 = 1, Cutpos = 30) print(res) ## End(Not run)
## Not run: DatabaseGroup <- get_example_fMRI_data_group() data("covariates", package="BayesDLMfMRI") res <- GroupSingleVoxelFFBS(posi.ffd = c(14, 56, 40), DatabaseGroup, covariates = Covariates, m0 = 0, Cova = 100, delta = 0.95, S0 = 1, n0 = 1, N1 = FALSE, Nsimu1 = 100, r1 = 1, Cutpos = 30) print(res) ## End(Not run)
Print the structure of the object related to the ffdEvidence* functions.
## S3 method for class 'fMRI_single_evidence' print(x, ...)
## S3 method for class 'fMRI_single_evidence' print(x, ...)
x |
is the returned value of any of the ffdEvidence* functions |
... |
Other potential arguments |
Print the structure of the object related to the ffdEvidence* functions.
## Not run: fMRI.data <- get_example_fMRI_data() data("covariates", package="BayesDLMfMRI") res <- ffdEvidenceFFBS(ffdc = fMRI.data, covariates = Covariates, m0=0, Cova=100, delta=0.95, S0=1, n0=1, N1=FALSE, Nsimu1 = 100, Cutpos1=30, r1 = 1, perVol = 0.10, Ncores=3) print(res) ## End(Not run)
## Not run: fMRI.data <- get_example_fMRI_data() data("covariates", package="BayesDLMfMRI") res <- ffdEvidenceFFBS(ffdc = fMRI.data, covariates = Covariates, m0=0, Cova=100, delta=0.95, S0=1, n0=1, N1=FALSE, Nsimu1 = 100, Cutpos1=30, r1 = 1, perVol = 0.10, Ncores=3) print(res) ## End(Not run)
Print the structure of the object related to the SingleVoxel* functions.
## S3 method for class 'fMRI_single_voxel' print(x, ...)
## S3 method for class 'fMRI_single_voxel' print(x, ...)
x |
is the returned value of any of the SingleVoxel* functions, |
... |
Other potential arguments |
Print the structure of the object related to the SingleVoxel* functions.
## Not run: fMRI.data <- get_example_fMRI_data() data("covariates", package="BayesDLMfMRI") res.indi <- SingleVoxelFSTS(posi.ffd = c(14, 56, 40), covariates = Covariates, ffdc = fMRI.data, m0 = 0, Cova = 100, delta = 0.95, S0 = 1, n0 = 1, Nsimu1 = 100, N1 = N1, Cutpos1 = 30, Min.vol = 0.10, r1 = 1) print(res.indi) ## End(Not run)
## Not run: fMRI.data <- get_example_fMRI_data() data("covariates", package="BayesDLMfMRI") res.indi <- SingleVoxelFSTS(posi.ffd = c(14, 56, 40), covariates = Covariates, ffdc = fMRI.data, m0 = 0, Cova = 100, delta = 0.95, S0 = 1, n0 = 1, Nsimu1 = 100, N1 = N1, Cutpos1 = 30, Min.vol = 0.10, r1 = 1) print(res.indi) ## End(Not run)
This function is used to perform an activation analysis for single voxels based on the FETS algorithm.
SingleVoxelFETS( posi.ffd, covariates, ffdc, m0, Cova, delta, S0, n0, N1, Nsimu1, Cutpos1, Min.vol, r1, Test )
SingleVoxelFETS( posi.ffd, covariates, ffdc, m0, Cova, delta, S0, n0, N1, Nsimu1, Cutpos1, Min.vol, r1, Test )
posi.ffd |
the position of the voxel in the brain image. |
covariates |
a data frame or matrix whose columns contain the covariates related to the expected BOLD response obtained from the experimental setup. |
ffdc |
a 4D array ( |
m0 |
the constant prior mean value for the covariates parameters and common to all voxels within every neighborhood at |
Cova |
a positive constant that defines the prior variances for the covariates parameters at |
delta |
a discount factor related to the evolution variances. Recommended values between |
S0 |
prior covariance structure among voxels within every cluster at |
n0 |
a positive hyperparameter of the prior distribution for the covariance matrix |
N1 |
is the number of images ( |
Nsimu1 |
is the number of simulated on-line trajectories related to the state parameters. These simulated curves are later employed to compute the posterior probability of voxel activation. |
Cutpos1 |
a cutpoint time from where the on-line trajectories begin. This parameter value is related to an approximation from a t-student distribution to a normal distribution. Values equal to or greater than 30 are recommended ( |
Min.vol |
helps to define a threshold for the voxels considered in
the analysis. For example, |
r1 |
a positive integer number that defines the distance from every voxel with its most distant neighbor. This value determines the size of the cluster. The users can set a range of different |
Test |
test type either |
This function allows the development of an activation analysis for single voxels. A multivariate dynamic linear model is fitted to a cluster of voxels, with its center at location (i,j,k)
, in the way it is presented in (Cardona-Jiménez and de B. Pereira 2021).
a list containing a vector (Evidence) with the evidence measure of
activation for each of the p
covariates considered in the model, the simulated
online trajectories related to the state parameter, the simulated BOLD responses,
and a measure to examine the goodness of fit of the model \((100 \ast |Y[i,j,k]_t - \hat{Y}[i,j,k]_t |/ \hat{Y}[i,j,k]_t )\) for that particular voxel (FitnessV
).
Cardona-Jiménez J, de B. Pereira CA (2021). “Assessing dynamic effects on a Bayesian matrix-variate dynamic linear model: An application to task-based fMRI data analysis.” Computational Statistics & Data Analysis, 163, 107297. ISSN 0167-9473, doi:10.1016/j.csda.2021.107297, https://www.sciencedirect.com/science/article/pii/S0167947321001316.
Cardona-Jiménez J (2021). “BayesDLMfMRI: Bayesian Matrix-Variate Dynamic Linear Models for Task-based fMRI Modeling in R.” arXiv e-prints, arXiv–2111.
## Not run: # This example can take a long time to run. fMRI.data <- get_example_fMRI_data() data("covariates", package="BayesDLMfMRI") res.indi <- SingleVoxelFETS(posi.ffd = c(14, 56, 40), covariates = Covariates, ffdc = fMRI.data, m0 = 0, Cova = 100, delta = 0.95, S0 = 1, n0 = 1, Nsimu1 = 100, N1 = FALSE, Cutpos1 = 30, Min.vol = 0.10, r1 = 1, Test = "LTT") ## End(Not run)
## Not run: # This example can take a long time to run. fMRI.data <- get_example_fMRI_data() data("covariates", package="BayesDLMfMRI") res.indi <- SingleVoxelFETS(posi.ffd = c(14, 56, 40), covariates = Covariates, ffdc = fMRI.data, m0 = 0, Cova = 100, delta = 0.95, S0 = 1, n0 = 1, Nsimu1 = 100, N1 = FALSE, Cutpos1 = 30, Min.vol = 0.10, r1 = 1, Test = "LTT") ## End(Not run)
This function is used to perform an activation analysis for single voxels based on the FFBS algorithm.
SingleVoxelFFBS( posi.ffd, covariates, ffdc, m0, Cova, delta, S0, n0, N1, Nsimu1, Cutpos1, Min.vol, r1 )
SingleVoxelFFBS( posi.ffd, covariates, ffdc, m0, Cova, delta, S0, n0, N1, Nsimu1, Cutpos1, Min.vol, r1 )
posi.ffd |
the position of the voxel in the brain image. |
covariates |
a data frame or matrix whose columns contain the covariates related to the expected BOLD response obtained from the experimental setup. |
ffdc |
a 4D array ( |
m0 |
the constant prior mean value for the covariates parameters and common to all voxels within every neighborhood at |
Cova |
a positive constant that defines the prior variances for the covariates parameters at |
delta |
a discount factor related to the evolution variances. Recommended values between |
S0 |
prior covariance structure among voxels within every cluster at |
n0 |
a positive hyperparameter of the prior distribution for the covariance matrix |
N1 |
is the number of images ( |
Nsimu1 |
is the number of simulated on-line trajectories related to the state parameters. These simulated curves are later employed to compute the posterior probability of voxel activation. |
Cutpos1 |
a cutpoint time from where the on-line trajectories begin. This parameter value is related to an approximation from a t-student distribution to a normal distribution. Values equal to or greater than 30 are recommended ( |
Min.vol |
helps to define a threshold for the voxels considered in
the analysis. For example, |
r1 |
a positive integer number that defines the distance from every voxel with its most distant neighbor. This value determines the size of the cluster. The users can set a range of different |
This function allows the development of an activation analysis for single voxels. A multivariate dynamic linear model is fitted to a cluster of voxels, with its center at location (i,j,k), in the way it is presented in (Cardona-Jiménez and de B. Pereira 2021).
a list containing a vector (Evidence) with the evidence measure of
activation for each of the p
covariates considered in the model, the simulated
online trajectories related to the state parameter, the simulated BOLD responses,
and a measure to examine the goodness of fit of the model \((100 \ast |Y[i,j,k]_t - \hat{Y}[i,j,k]_t |/ \hat{Y}[i,j,k]_t )\) for that particular voxel (FitnessV
).
Cardona-Jiménez J, de B. Pereira CA (2021). “Assessing dynamic effects on a Bayesian matrix-variate dynamic linear model: An application to task-based fMRI data analysis.” Computational Statistics & Data Analysis, 163, 107297. ISSN 0167-9473, doi:10.1016/j.csda.2021.107297, https://www.sciencedirect.com/science/article/pii/S0167947321001316.
Cardona-Jiménez J (2021). “BayesDLMfMRI: Bayesian Matrix-Variate Dynamic Linear Models for Task-based fMRI Modeling in R.” arXiv e-prints, arXiv–2111.
## Not run: # This example can take a long time to run. fMRI.data <- get_example_fMRI_data() data("covariates", package="BayesDLMfMRI") res.indi <- SingleVoxelFFBS(posi.ffd = c(14, 56, 40), covariates = Covariates, ffdc = fMRI.data, m0 = 0, Cova = 100, delta = 0.95, S0 = 1, n0 = 1, Nsimu1 = 100, N1 = FALSE, Cutpos1 = 30, Min.vol = 0.10, r1 = 1) ## End(Not run)
## Not run: # This example can take a long time to run. fMRI.data <- get_example_fMRI_data() data("covariates", package="BayesDLMfMRI") res.indi <- SingleVoxelFFBS(posi.ffd = c(14, 56, 40), covariates = Covariates, ffdc = fMRI.data, m0 = 0, Cova = 100, delta = 0.95, S0 = 1, n0 = 1, Nsimu1 = 100, N1 = FALSE, Cutpos1 = 30, Min.vol = 0.10, r1 = 1) ## End(Not run)
This function is used to perform an activation analysis for single voxels based on the FSTS algorithm.
SingleVoxelFSTS( posi.ffd, covariates, ffdc, m0, Cova, delta, S0, n0, N1, Nsimu1, Cutpos1, Min.vol, r1 )
SingleVoxelFSTS( posi.ffd, covariates, ffdc, m0, Cova, delta, S0, n0, N1, Nsimu1, Cutpos1, Min.vol, r1 )
posi.ffd |
the position of the voxel in the brain image. |
covariates |
a data frame or matrix whose columns contain the covariates related to the expected BOLD response obtained from the experimental setup. |
ffdc |
a 4D array ( |
m0 |
the constant prior mean value for the covariates parameters and common to all voxels within every neighborhood at |
Cova |
a positive constant that defines the prior variances for the covariates parameters at |
delta |
a discount factor related to the evolution variances. Recommended values between |
S0 |
prior covariance structure among voxels within every cluster at |
n0 |
a positive hyperparameter of the prior distribution for the covariance matrix |
N1 |
is the number of images ( |
Nsimu1 |
is the number of simulated on-line trajectories related to the state parameters. These simulated curves are later employed to compute the posterior probability of voxel activation. |
Cutpos1 |
a cutpoint time from where the on-line trajectories begin. This parameter value is related to an approximation from a t-student distribution to a normal distribution. Values equal to or greater than 30 are recommended ( |
Min.vol |
helps to define a threshold for the voxels considered in
the analysis. For example, |
r1 |
a positive integer number that defines the distance from every voxel with its most distant neighbor. This value determines the size of the cluster. The users can set a range of different |
This function allows the development of an activation analysis for single voxels. A multivariate dynamic linear model is fitted to a cluster of voxels, with its center at location (i,j,k)
, in the way it is presented in (Cardona-Jiménez and de B. Pereira 2021).
a list containing a vector (Evidence) with the evidence measure of
activation for each of the p
covariates considered in the model, the simulated
online trajectories related to the state parameter, the simulated BOLD responses,
and a measure to examine the goodness of fit of the model \((100 \ast |Y[i,j,k]_t - \hat{Y}[i,j,k]_t |/ \hat{Y}[i,j,k]_t )\) for that particular voxel (FitnessV
).
Cardona-Jiménez J, de B. Pereira CA (2021). “Assessing dynamic effects on a Bayesian matrix-variate dynamic linear model: An application to task-based fMRI data analysis.” Computational Statistics & Data Analysis, 163, 107297. ISSN 0167-9473, doi:10.1016/j.csda.2021.107297, https://www.sciencedirect.com/science/article/pii/S0167947321001316.
Cardona-Jiménez J (2021). “BayesDLMfMRI: Bayesian Matrix-Variate Dynamic Linear Models for Task-based fMRI Modeling in R.” arXiv e-prints, arXiv–2111.
## Not run: # This example can take a long time to run. fMRI.data <- get_example_fMRI_data() data("covariates", package="BayesDLMfMRI") res.indi <- SingleVoxelFSTS(posi.ffd = c(14, 56, 40), covariates = Covariates, ffdc = fMRI.data, m0 = 0, Cova = 100, delta = 0.95, S0 = 1, n0 = 1, Nsimu1 = 100, N1 = FALSE, Cutpos1 = 30, Min.vol = 0.10, r1 = 1) ## End(Not run)
## Not run: # This example can take a long time to run. fMRI.data <- get_example_fMRI_data() data("covariates", package="BayesDLMfMRI") res.indi <- SingleVoxelFSTS(posi.ffd = c(14, 56, 40), covariates = Covariates, ffdc = fMRI.data, m0 = 0, Cova = 100, delta = 0.95, S0 = 1, n0 = 1, Nsimu1 = 100, N1 = FALSE, Cutpos1 = 30, Min.vol = 0.10, r1 = 1) ## End(Not run)
Summary function
## S3 method for class 'fMRI_group_evidence' summary(object, ...)
## S3 method for class 'fMRI_group_evidence' summary(object, ...)
object |
is the returned value of any of the fdGroupEvidence* functions |
... |
Other potential arguments |
Summary function
## Not run: DatabaseGroup <- get_example_fMRI_data_group() data("covariates", package="BayesDLMfMRI") data("mask", package="BayesDLMfMRI") res <- ffdGroupEvidenceFETS(ffdGroup = DatabaseGroup, covariates = Covariates, m0 = 0, Cova = 100, delta = 0.95, S0 = 1, n0 = 1, N1 = FALSE, Nsimu1 = 100, Cutpos=30, r1 = 1, Test = "JointTest", mask = mask, Ncores = 7) summary(res) ## End(Not run)
## Not run: DatabaseGroup <- get_example_fMRI_data_group() data("covariates", package="BayesDLMfMRI") data("mask", package="BayesDLMfMRI") res <- ffdGroupEvidenceFETS(ffdGroup = DatabaseGroup, covariates = Covariates, m0 = 0, Cova = 100, delta = 0.95, S0 = 1, n0 = 1, N1 = FALSE, Nsimu1 = 100, Cutpos=30, r1 = 1, Test = "JointTest", mask = mask, Ncores = 7) summary(res) ## End(Not run)
Summary function
## S3 method for class 'fMRI_single_evidence' summary(object, ...)
## S3 method for class 'fMRI_single_evidence' summary(object, ...)
object |
is the returned value of any of the ffdEvidence* functions |
... |
Other potential arguments |
Summary function
## Not run: fMRI.data <- get_example_fMRI_data() data("covariates", package="BayesDLMfMRI") res <- ffdEvidenceFFBS(ffdc = fMRI.data, covariates = Covariates, m0=0, Cova=100, delta=0.95, S0=1, n0=1, N1=FALSE, Nsimu1 = 100, Cutpos1=30, r1 = 1, perVol = 0.10, Ncores=3) summary(res) ## End(Not run)
## Not run: fMRI.data <- get_example_fMRI_data() data("covariates", package="BayesDLMfMRI") res <- ffdEvidenceFFBS(ffdc = fMRI.data, covariates = Covariates, m0=0, Cova=100, delta=0.95, S0=1, n0=1, N1=FALSE, Nsimu1 = 100, Cutpos1=30, r1 = 1, perVol = 0.10, Ncores=3) summary(res) ## End(Not run)