ngme.par | R Documentation |
Maximum likelihood model estimation using parallel runs of
stochastic gradient estimation. See ngme
and ngme.spatial
for explanation of the model specification.
ngme.par(
n.cores = 4,
std.lim = 0.1,
trend.lim = 0.01,
max.rep = 10,
controls = NULL,
controls.init = NULL,
use.process = TRUE,
nIter = 1000,
timeVar = NULL,
location.names = NULL,
init.fit = NULL,
silent = FALSE,
plot.type = "All",
save.tracks = FALSE,
...
)
n.cores |
Number of cores, and the number of parallel chains, to use. Default is 4. |
std.lim |
Parameter for first convergence criterium. The estimation is stopped when the estimated Monte Carlo standard deviation for each parameter is less than std.lim times the parameter value. Default is 0.1. |
trend.lim |
Parameter for second convergence criterium. The estimation is stopped when the rate of change per batch of nIter iterations is not significantly larger than trend.lim times the current parameter value. Default is 0.01. |
max.rep |
The total number of iterations that is run is given by |
nIter |
The number of iterations per batch of runs. Default is 1000. |
plot.type |
Set to "All" to get parameter trajectories of all estimated parameters. However, at most 16 parameters are plotted at once. Set to "TRUE" or "Fixed" to get plots of only the fixed effects. |
save.tracks |
Save the individual parameter tracks for the parallel runs? Default FALSE. |
... |
Other parameter needed by |
The function calls ngme
or ngme.spatial
internally. See these functions for further information
on the actual
model specification. When plots of parameter trajectories are shown, the gray lines show the trajectories of the individual
runs and the black curve is the estimate obtained by averaging the individual trajectories. The green lines show approximate
95 percent confidence bands for the estimate.
A list of outputs.
David Bolin davidbolin@gmail.com
ngme
, ngme.spatial
## Not run:
data(srft_data)
#Consider a subsample of the data
rs_id <- sample(unique(srft_data$id), 731, replace = FALSE)
srft_data_sub <- srft_data[srft_data$id %in% rs_id, ]
# fit the model with normal assumption for random effects, process and error
fit_normal <- ngme.par(fixed = log(egfr) ~ sex + bage + fu + pwl,
random = ~ 1|id,
data = srft_data_sub,
reffects = "Normal",
process = c("Normal", "fd2"),
error = "Normal",
timeVar = "fu",
n.cores = 5,
std.lim = 100,
max.rep = 20,
nIter = 500,
use.process = TRUE,
silent = FALSE,
mesh = list(cutoff = 1/365, max.dist = 1/12, extend = 0.01),
controls = list(pSubsample = 0.1))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.