dmm() to create a dmm object from
parameters given by the user (points of support transition matrices,
initial law, order, degree and length), like
smmparametric() and smmnonparametric() in
smmR.dmm object is now stored in
x$init (instead of x$init.estim). It is always
a named numeric vector, in the same order as the rows of the transition
matrices. The argument init.estim of fitdmm()
is unchanged.simulate() and simulate.dmm() no longer
have an ncpu argument, since the simulation is
sequential.simulate() is now a method of
stats::simulate()
(simulate(object, nsim = 1, seed = NULL, output_file = NULL, model_size = NULL, ...)),
so loading drimmR no longer masks
stats::simulate. Several sequences can be simulated
(nsim) and the seed can be given. The former call
simulate(x, output_file, model_size) with positional
arguments still works but is deprecated. simulate() no
longer prints a message.DESCRIPTION: Geoffray Brelurut and Georges Sadaka
are added as authors to Authors@R; the description is
rewritten.
Vignette: the sections on the simulation and on the reliability
measures use the names of the functions and arguments of the package
(simulate(), availability(),
reliability(), maintainability(),
failureRate(), upstates,
failure.rate), the arguments fit.method and
init.estim of fitdmm() are described, and the
formulas of the BMP and RG failure rates are displayed
correctly.
Faster computations: the transition matrices of a range of
positions are computed at once (vectorized), and the distributions,
stationary laws, reliability measures, word probabilities and
simulations use them. On the phage lambda (48 501 positions, order 1),
distributions() over the whole sequence takes 0.3 s,
getStationaryLaw(all.pos = TRUE) about 3 s instead of about
30 s, words_probabilities() and
word_probabilities() are about 25 times faster and
simulate() about 4 times faster.
The packages parallel, parallelly,
doParallel and foreach are no longer used: the
parallel computations cost more than they saved. The argument
ncpu is kept for compatibility and has no effect.
getStationaryLaw() no longer warns about the
computation time for orders > 1.
fitdmm(fit.method = "mean") uses the length of each
sequence for its own estimator without changing the length of the model
(the last sequence could set it).
getTransitionMatrix() now always returns a stochastic
matrix: negative probabilities, which can occur when
degree > 1 (negative Lagrange coefficients), are set to
0 and each row is normalized. simulate.dmm() uses the same
normalization.simulate.dmm() now draws each state conditionally on
the order previous states of the simulated sequence. It
previously used the first order states for every position,
so the simulated sequences were not drifting Markov chains.simulate.dmm() now draws the order first
states according to the initial law x$init (they were
previously drawn independently from the stationary law).fitdmm() and failureRate() can be called
without init.estim and failure.rate: the
defaults ("mle" and "BMP") failed with “the
condition has length > 1”.fitdmm() now normalizes the position of
X_t as t / n, as
getTransitionMatrix() and simulate.dmm() do.
It previously used (t + 1) / (n - 1), so that the
normalized positions exceeded 1 at the end of the sequence (differences
of order 1/n on the estimates).fitdmm(): a custom initial law (numeric vector
init.estim) failed with “‘length = 4’ in coercion to
‘logical(1)’”; its sum is now compared to 1 with a tolerance.fitdmm() and dmm(): the states are sorted
in alphabetical order in the returned object. With states given in
another order, fitdmm() labelled the columns of the
transition matrices with the wrong states (and
word_probability() used the wrong rows).fitdmm() now rejects a non-integer order
or degree (order = 1.5 led to an infinite
recursion), sequences given as a matrix (with the intended message),
states absent from states and an unknown
fit.method. The documented fit.method = "mean"
is now described.loglik() (and therefore aic() and
bic()) now computes the log-likelihood of the model:
initial law x$init for the order first states
(instead of stationary laws), transition matrix at position
t for X_t (instead of t - 1) and
all the transitions for orders >= 3.getDistribution(all.pos = TRUE) and
distributions() work for orders >= 2;
distributions() uses the initial law x$init
(instead of the stationary law at start + order - 1).distributions() and
stationary_distributions() can be called without
step (default 1; step = NULL failed).reliability() and maintainability() were
shifted by one position: they returned 1 (resp. 0) at position 0 and the
value of position k - 1 at position k. Now
R(k) = P(X_0, ..., X_k in U) and
M(k) = 1 - P(X_0, ..., X_k in D) (for order k > 1, the
k first states are those of the initial word).
failureRate() is computed from the corrected reliability,
with R(-1) = 1.availability(), reliability(),
maintainability() and failureRate() check
k2 (the end of the frame was not checked) and compute the
products of matrices recursively.lengthWord_probabilities() returns numeric
position and probability columns (all the
columns were character strings), and the word beginning at
sequence[i] is studied at position i - 1 of
the model (sequence[i] is X_{i-1}).word_probability(): words shorter than the order are
handled (sum over the words of length order beginning with
the word).tests/testthat): exact laws, log-likelihood
and reliability measures computed by enumeration of all the sequences of
small models.fig.jpg:
it described the C++ program DRIMM (configuration files, spline
estimators) rather than this package, and in 1.0.4 the file was a Git
LFS pointer displayed as a broken image. It is replaced by a table of
the functions by task. Duplicated section anchors of the vignette are
fixed.vignettes/ directory and
VignetteBuilder: knitr in DESCRIPTION, so
vignette("drimmR") is available again.utils is no longer listed in Suggests
while being imported in NAMESPACE.parallelly is imported with
@importFrom parallelly availableCores instead of a full
@import.output_file to
tempfile() instead of file.txt.ncpu to 2.ncpu parameter to parallel functions.donttest to testthat for tests
running under 5 seconds.dontrun examples with donttest
(WARNING: This caused errors in package compilation because examples use
more than 2 nodes).DESCRIPTION file after
first review.foreach and doSNOW packages from
code and dependencies (DESCRIPTION file) following CRAN
pre-test notes.VignetteBuilder (WARNING:
VignetteBuilder was later added back to
DESCRIPTION after adding the “vignette” directory; see
devtools_history.R file).k1 parameter in reliability measures
(+k1 is now NULL by default).drimmR-package help
page).length attribute of the model from
length(sequence) - 1 to X_0 to
X_n in dmmsum function, following meeting
remarks (2021-02-18).\dontrun to example code to pass CRAN tests.globals.R for global variables to pass CRAN
tests.output_file argument to several functions, added
references, and corrections following tests).getStationaryLaw and getDistribution
functions).words_probas plot scaling issue.word_expect function (not yet
implemented).words_probas roxygen imports (filter function
was not recognized).simulate function to return simulated
sequences.DESCRIPTION file.dmmsum,
errorRATE, availability,
maintainability, and reliability
functions.mod with x).allgenerics.R file to gather all S3 generic
functions. Deleted former S3 generic function files (e.g.,
simulate.R).plot.R file.words_probas function.word_proba,
word_probas, and length_probas.