You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: R/pt_create_pParams.R
+7-6Lines changed: 7 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -2,11 +2,10 @@
2
2
#'
3
3
#' creates the required input for \code{\linkS4class{ptable}}.
4
4
#'
5
-
#' @param D perturbation parameter for maximum perturbation (scalar or vector)
5
+
#' @param D perturbation parameter for maximum noise/perturbation (scalar or vector)
6
6
#' @param V perturbation parameter for variance (scalar)
7
-
#' @param js treshold value for blocking of small frequencies (i.e. there won't occur positive target frequencies below the treshold value)
8
-
#' Target frequencies are defined by ...
9
-
#' @param pstay optional parameter to set
7
+
#' @param js treshold value for blocking of small frequencies (i.e. the perturbation will not produce positive cell values that are equal to or smaller than the treshold value).
8
+
#' @param pstay optional parameter to set the probability (0 < p < 1) of an original frequency to remain unperturbed: NA (default) no preset probability (i.e. produces the maximum entropy solution)
10
9
#' @param optim optimization parameter: \code{1} standard approach (default)
Copy file name to clipboardExpand all lines: R/pt_create_pTable.R
+11-7Lines changed: 11 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,18 @@
1
1
#' pt_create_pTable
2
2
#'
3
3
#' produces perturbation table that is needed to add noise to statistical frequency tables. The perturbation probabilities are constructed given the following constraints:
4
-
#' 1. Zero mean
5
-
#' 2. Constant variance
6
-
#' 3. Probabilities are between zero and one
7
-
#' 4.
8
-
#' 5. probabilities sum up to 1
4
+
#' - Unbiasedness of the noise
5
+
#' - Fixed noise variance
6
+
#' - Transition probabilities are between zero and one and the sum up to 1
7
+
#' - Perturbations will not produce negaive cell values or positive cell values equal to or less than a specific threshold value
8
+
#' - The absolute value of any perturbation is less than a specific integer value (i.e. the maxiumum noise)
9
+
#'
10
+
#' For more information, see the vignette using \code{pt_vignette()}.
9
11
#' @md
10
12
#'
11
13
#' @param params an object of class \code{\linkS4class{ptable_params}}
12
14
#' generated with \code{\link{pt_create_pParams}}
13
-
#' @param type (character) type of pTable (either 'abs' or 'destatis')
15
+
#' @param type (character) type of pTable, either 'destatis' (default) or 'abs' or 'abs2'
value=3, min = 0.1, max = 5, step = 0.1, width="100px")
28
28
sliderInput("js", label = "Treshold (=js)",
29
29
min = 0, max = 5, value = 2, step = 1)
30
-
sliderInput("pstay", label = "Probability of frequencies not to be perturbed (=pstay)",
31
-
min = 0, max = 1, value = 0, step = 0.05)
30
+
31
+
numericInput(inputId="pstay", label="Preset probability of frequencies not to be perturbed (=pstay)", value=NA, min = 0.05, max = 0.99, step = 0.05, width="200px")
32
+
#checkboxInput("pstayset", "Preset probability of frequencies not to be perturbed (=pstay)", value=FALSE, width = NULL)
33
+
#test <- reactive(input$pstayset)
34
+
#if (reactive(test()) == TRUE) pstay <- NA
35
+
#sliderInput("pstay", label = "Set probability (=pstay)",
36
+
# min = 0.05, max = 0.95, value = 0.5, step = 0.05)
32
37
33
38
checkboxInput("mono", "Set Monotony", value = TRUE, width = NULL)
34
39
radioButtons("optim", "Set of objective functions (=optim)",
0 commit comments