This function estimates the effects of a synthetic spatiotemporal data set resembling functional MR Images (fMRI), with the method of efficient Markov Chain Monte Carlo (MCMC) simulation. The Metropolis Hastings (MH) algorithm is used for the non-approximate case and the Gibbs sampler for the approximate case.

1 2 3 | ```
sim.adaptiveGMRF(data, hrf, approximate = FALSE, K = 500,
a = 1, b = 1, c = 1, d = 1, nu = 1, block = 1, burnin =
1, thin = 1)
``` |

`data` |
simulated fMRI-data, needs to be an array of
dimension |

`hrf` |
haemodynamic response function, needs to be a
vector of length |

`approximate` |
logical, if |

`K` |
scalar, length of the MCMC path, hence iteration steps. |

`a` |
scalar, shape hyperparameter of the
inverse-gamma distribution of the variance parameter
( |

`b` |
scalar, scale hyperparameter of the inverse
gamma distribution of the variance parameter
( |

`c` |
scalar, shape hyperparameter of the inverse
gamma distribution of the precision parameter
( |

`d` |
scalar, scale hyperparameter of the inverse
gamma distribution of the precision parameter
( |

`nu` |
scalar, shape and scale hyperparameter of the
gamma distribution of the interaction weights
( |

`block` |
scalar, when |

`burnin` |
scalar, defining the first iteration steps which should be omitted from MCMC path. |

`thin` |
scalar, only every |

This function is solely for one covariate.

Max Hughes

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ```
# non-transformed hr-function
T <- 210
seq.length <- T*3
index <- seq(3, T*3, by = 3)
hrf <- rep(c(-0.5, 0.5), each=30, times=ceiling(T/30*1.5))
hrf <- as.matrix(hrf[index])
# get simulated data
data("sim_fmri")
data <- data_simfmri
# execute function
set.seed(111222)
K <- 2
a <- b <- c <- d <- nu <- 1
test.sim.adaptive <- sim.adaptiveGMRF(data, hrf, approximate=TRUE, K,
a, b, c, d, nu)
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.