Skip to content

Commit

Permalink
🔀 merge pull request #3 from lenarddome/feature-init-matrix
Browse files Browse the repository at this point in the history
fix bug where continuous model output is not saved
  • Loading branch information
lenarddome committed Aug 17, 2023
2 parents c892989 + 198e23d commit 63cc309
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 31 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
@@ -1,7 +1,7 @@
Package: psp
Title: Parameter Space Partitioning MCMC for Global Model Evaluation
Version: 1.0.0
Date: 2022-08-12
Version: 1.0.1
Date: 2023-08-16
Authors@R: c(person("Lenard", "Dome",
email = "lenarddome@gmail.com",
role = c("aut", "cre")),
Expand Down
2 changes: 2 additions & 0 deletions docs/CHANGELOG.md
Expand Up @@ -7,6 +7,8 @@ Our versioning convenvtions are based on [Semantic Versioning](https://semver.or

## [Unreleased]

- 69ed02814ca5a53f773ce13f2ad8faf441ec05c6 :ambulance: continuous model output is not updated

## v1.0.0

This release introduces breaking changes to the API.
Expand Down
11 changes: 11 additions & 0 deletions man/pspGlobal.Rd
Expand Up @@ -65,22 +65,33 @@ pspGlobal(model, discretize, control, save = FALSE, path = ".",
\code{population}{The number of parameter sets in each ordinal region,
which serves as a threshold above which pspGlobal will not generate
a new jumping distribution for a given ordinal pattern.}

\code{iterations}{The number of global iterations. It has to be an integer. If emph{population} is not set or the regions have population less then the upper bound on their size, the function will stop after the set number of \emph{iterations}.}

\code{lower, upper}{Vectors specifiying the lower and upper boundaries of
the parameter space for each parameter. The i-th element of lower and
upper bounds applies to the i-th parameter.}

\code{init}{A marix of parameters to use as the first jumping distribution.
Each row contains the parameter set, whereas columns correspond to
freely varying paarameters of the model.}

\code{radius}{The radius of the hypershere with n-dimensions to sample from.
Must be of type double. If you are unsure what to set here, set it to 1.}

\code{parameter_names}{A character vector that includes the names of each parameter.
The order of elements should correspond to the order of parameter columns in
init.}

\code{stimuli_names}{A character vector that includes the names of each continuous
model output. The order of elements should correspond to the order of
continuous model output in function model.}

\code{dimensionality}{A single integer that specifies the number of
dimensions for the inequality matrix. The inequality matrix is a strict
upper triangular matrix. The number of rows and columns is equal to each
other.}

\code{responses}{It is an integer that specifies the number of continuous
variables the model output before the ordinal function is applied. See Note 2.}

Expand Down
14 changes: 0 additions & 14 deletions src/Makevars

This file was deleted.

14 changes: 0 additions & 14 deletions src/Makevars.win

This file was deleted.

4 changes: 3 additions & 1 deletion src/pspGlobal.cpp
Expand Up @@ -280,6 +280,8 @@ List pspGlobal(Function model, Function discretize, List control, bool save = fa
for (uword i = 0; i < jumping_distribution.n_rows; i++) {
NumericVector probabilities = model(jumping_distribution.row(i));
NumericMatrix teatime = discretize(probabilities);
const rowvec& responses = as<rowvec>(probabilities);
continuous.row(i) = responses;
const mat& evaluate = as<mat>(teatime);
ordinal.slice(i) = evaluate;
}
Expand All @@ -303,7 +305,7 @@ List pspGlobal(Function model, Function discretize, List control, bool save = fa
// index locations of currently found patterns in storage
vec match = MatchJumpDists(storage, ordinal);
WriteFile(iteration, jumping_distribution, match, path + "_parameters" + extension);
WriteFile(0, continuous, match, path + "_continuous" + extension);
WriteFile(iteration, continuous, match, path + "_continuous" + extension);
}

// check if either of the parameter_filled thresholds is reached
Expand Down

0 comments on commit 63cc309

Please sign in to comment.