From 697f1dc05d8805ee3a8fbf2021262ab704000619 Mon Sep 17 00:00:00 2001 From: Reinhold <8436725+reikoch@users.noreply.github.com> Date: Mon, 7 Oct 2024 12:23:41 +0200 Subject: [PATCH] document that a markovchain object can now be created from a transition matrix of class Matrix --- DESCRIPTION | 5 +++-- src/probabilistic.cpp | 2 +- vignettes/an_introduction_to_markovchain_package.Rmd | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 66e4eb2..b6b3246 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: markovchain Type: Package Title: Easy Handling Discrete Time Markov Chains -Version: 0.10.0.9007 +Version: 0.10.0.9100 Authors@R: c( person("Giorgio Alfredo", "Spedicato", role = c("aut", "cre"), email = "spedicato_giorgio@yahoo.it",comment = c(ORCID = "0000-0002-0315-8888")), @@ -14,7 +14,8 @@ Authors@R: c( person("Toni", "Giorgino", role="ctb", comment = c(ORCID = "0000-0001-6449-0596")), person("Richèl J.C.", "Bilderbeek", role = "ctb", comment = c(ORCID = "0000-0003-1107-7049")), person("Daniel", "Ebbert", email = "daniel@ebbert.nrw", role = "ctb", comment = c(ORCID = "0000-0003-3666-7205")), - person("Shreyash", "Maheshwari", email = "coolshreysh1000@gmail.com", role = "ctb") + person("Shreyash", "Maheshwari", email = "coolshreysh1000@gmail.com", role = "ctb"), + person("Reinhold", "Koch", role = "ctb") ) Maintainer: Giorgio Alfredo Spedicato Description: Functions and S4 methods to create and manage discrete time Markov diff --git a/src/probabilistic.cpp b/src/probabilistic.cpp index 3b43ac8..b5d7ba2 100644 --- a/src/probabilistic.cpp +++ b/src/probabilistic.cpp @@ -12,7 +12,7 @@ using namespace std; using namespace arma; template -T sortByDimNames(const T mat); +T sortByDimNames(const T m); typedef unsigned int uint; diff --git a/vignettes/an_introduction_to_markovchain_package.Rmd b/vignettes/an_introduction_to_markovchain_package.Rmd index 8c14fbf..12441d5 100644 --- a/vignettes/an_introduction_to_markovchain_package.Rmd +++ b/vignettes/an_introduction_to_markovchain_package.Rmd @@ -325,7 +325,7 @@ defaultMc <- new("markovchain") The quicker way to create `markovchain` objects is made possible thanks to the implemented `initialize` S4 method that checks that: - * the `transitionMatrix` to be a transition matrix, i.e., all entries to be probabilities and either all rows or all columns to sum up to one. + * the `transitionMatrix`, either of class matrix or Matrix, to be a transition matrix, i.e., all entries to be probabilities and either all rows or all columns to sum up to one. * the columns and rows names of `transitionMatrix` to be defined and to coincide with `states` vector slot. The `markovchain` objects can be collected in a list within `markovchainList` S4 objects as following example shows.