Type: | Package |
Title: | Modelling and Simulating Judgments of Frequency |
Version: | 0.1.0 |
Maintainer: | Markus Burkhardt <markus.burkhardt@psychologie.tu-chemnitz.de> |
Description: | In a typical experiment for the intuitive judgment of frequencies (JoF) different stimuli with different frequencies are presented. The participants consider these stimuli with a constant duration and give a judgment of frequency. These judgments can be simulated by formal models: PASS 1 and PASS 2 based on Sedlmeier (2002, ISBN:978-0198508632), MINERVA 2 baesd on Hintzman (1984) <doi:10.3758/BF03202365> and TODAM 2 based on Murdock, Smith & Bai (2001) <doi:10.1006/jmps.2000.1339>. The package provides an assessment of the frequency by determining the core aspects of these four models (attention, decay, and presented frequency) that can be compared to empirical results. |
Depends: | R (≥ 3.1.0) |
License: | GPL-3 |
Encoding: | UTF-8 |
LazyData: | true |
RoxygenNote: | 7.0.2 |
Suggests: | testthat, knitr, rmarkdown |
VignetteBuilder: | knitr |
NeedsCompilation: | no |
Packaged: | 2020-04-02 07:20:53 UTC; burma |
Author: | Markus Burkhardt [aut, cre] |
Repository: | CRAN |
Date/Publication: | 2020-04-03 14:10:36 UTC |
Modeling Judgments of Frequency with MINERVA 2
Description
Modeling Judgments of Frequency with MINERVA 2
Usage
MINERVA2(x, y, ..., sqc, L, dec = NULL)
Arguments
x |
input handled by MINERVA 2. Values -1, 0 and 1 are allowed. -1 represents the absence of a feature, 0 the irrelevance of a feature and 1 the presence of a feature. |
y |
another input handled by MINERVA 2. At least two inputs are needed for the simulation. |
... |
other inputs for modeling. |
sqc |
sequence of the different objects. Each input gets
an ascending number. |
L |
learning parameter. This is the proportion of a
correctly stored vector. |
dec |
decay is not part of the original version of MINERVA 2.
This is just implemented for a better comparison with the other
models of JoF. In |
Details
Calculations of MINERVA 2 contain four steps.
S_{i} = \frac{\sum_{j=1}^{N}{P_{j}T_{ij}}}{N_{i}}
A_{i} = S_{i}^{3}
I = \sum_{i=1}^{M}{A_{i}}
relative JoF = \frac{I_{j}}{\sum_{j}^{K}{I_{j}}}
Value
MINERVA2 returns the relative judgment of frequency
References
Dougherty, M. R., Gettys, C. F., & Ogden, E. E. (1999). MINERVA-DM: A memory processes model for judgments of likelihood. Psychological Review, 106(1), 180.
Hintzman, D. L. (1984). MINERVA 2: A simulation model of human memory. Behavior Research Methods, Instruments, and Computers, 16, 96–101.
Examples
#This example is presented in Dougherty,
#Gettys, & Ogden, 1999 (p. 185)
H1 <- c(-1, 1, 0, 1, 0, -1, 1, -1, 0)
H2 <- c(-1, 0, 0, 1, 0, 0, 1, 0, 0)
x <- MINERVA2(H1, H2, sqc = c(2, 1), L = 1)
Modeling Judgments of Frequency with PASS 1
Description
Modeling Judgments of Frequency with PASS 1
Usage
PASS1(x, y, ..., sqc, att, dec, ifc, rdm_weights = TRUE, noise = 0)
Arguments
x |
input handled by PASS 1. Only binary input is allowed. |
y |
a second binary input handled by PASS 1. At least two inputs are needed for the simulation. |
... |
other binary inputs for modeling. |
sqc |
sequence of the different objects. Each input gets
an ascending number. |
att |
attention is a vector with numeric values
between 0 and 1. |
dec |
decay is a vector with numeric values between
-1 and 0. |
ifc |
interference is a vector with numeric values
between -1 and 0. |
rdm_weights |
a logical value indicating whether random
weights in the neural network are used or not. If
|
noise |
a proportion between 0 and 1 which determine the number of randome activiated inputunits (hihger numbers indicate higher noise). |
Details
PASS 1 is a simple neural pattern associator learning by delta rule.
Learning:
if U_{i} and U_{j} are activated, then
\Delta w_{ij} = \Theta_{1} ( 1 - w_{ij})
Interference:
if either U_{i} or U_{j} is activated, then
\Delta w_{ij} = \Theta_{2} * w_{ij}
Decay:
if neither U_{i} nor U_{j} is activated, then
\Delta w_{ij} = \Theta_{3} * w_{ij}
Value
PASS1
returns the relative judgment of frequency
for each input.
References
Sedlmeier, P. (2002). Associative learning and frequency judgements: The PASS model. In P. Sedlmeier, T. Betsch (Eds.), Etc.: Frequency processing and cognition (pp. 137-152). New York: Oxford University Press.
Examples
o1 <- c(1, 0, 0, 0)
o2 <- c(0, 1, 0, 0)
o3 <- c(0, 0, 1, 0)
o4 <- c(0, 0, 0, 1)
PASS1(o1, o2, o3, o4,
sqc = rep(1:4, 4:1), att = .1, dec = -.05,
ifc = -.025, rdm_weights = FALSE, noise = 0)
Modelling Judgments of Frequency with PASS 2
Description
Modelling Judgments of Frequency with PASS 2
Usage
PASS2(x, y, ..., sqc, att, n_output_units = "half", rdm_weights = F, noise = 0)
Arguments
x |
input handled by PASS 2. Only binary input is allowed. |
y |
a second binary input handled by PASS 1. At least two inputs are needed for the simulation. |
... |
other binary inputs for modeling. |
sqc |
sequence of the different objects. Each input gets
an ascending number. |
att |
attention is a vector with numeric values
between 0 and 1. |
n_output_units |
number of output units as numeric value.
This must be between 1 and the maximum number of input units.
|
rdm_weights |
a logical value indicating whether random
weights in the neural network are used or not. If
|
noise |
a proportion between 0 and 1 which determines the number of random activated input units (higher numbers indicate higher noise). |
Details
PASS 2 uses a competitive learning algorithm, which usually clusters the input as side effect. If weights are equal, the winning unit is chosen randomly, because of this, each simulation is slightly different.
if an outputuni O_{i} losses: \Delta w_{ij} = 0
if an outputuni O_{i} wins: \Delta w_{ij} = g_{w}
\frac{a_{i}}{\sum_{i}^{n}{a_{i}}} - g_{w}w_{ij}
Value
PASS2
returns the relative judgment of frequency
for each input.
References
Sedlmeier, P. (2002). Associative learning and frequency judgements: The PASS model. In P. Sedlmeier, T. Betsch (Eds.), Etc.: Frequency processing and cognition (pp. 137-152). New York: Oxford University Press.
Examples
o1 <- c(1, 0, 0, 0)
o2 <- c(0, 1, 0, 0)
o3 <- c(0, 0, 1, 0)
o4 <- c(0, 0, 0, 1)
PASS2(o1, o2, o3, o4,
sqc = rep(1:4, 4:1), att = .1, n_output_units = 2,
rdm_weights = FALSE, noise = 0)
Modeling Judgments of Frequency with TODAM 2
Description
Modeling Judgments of Frequency with TODAM 2
Usage
TODAM2(x, y, ..., sqc, gamma = 1, alpha = 1)
Arguments
x |
input handled by TODAM 2. Normal distributed inputs with mean = 0 and sd = 1 / n are allowed. This representation enables discrimination and similarity between different items. See vignette for details. |
y |
another input handled by TODAM 2. At least two inputs are needed for the simulation. |
... |
other inputs handled by TODAM 2. |
sqc |
sequence of the different objects. Each input gets
an ascending number. |
gamma |
is the atttention- or learningparameter. Values
between 0 and 1 are allowed. 1 represents perfect learning.
If |
alpha |
represents the decay. If |
Details
In the original publication TODAM 2 is more complex and has more parameters. Especially the design for the input is a concatenation between item and context. The normal distributed input has a mean = 0 and sd = 1/n. A pragmatic solution to make the models input comparable is to use a binary input like in PASS. There is no explicit argument for noise.
Convolution:
F_{i}^{2} = \sum_{i=1} f_{i} * f_{m-i+1} and m = 2n - 1
Memory:
M_{t} = \alpha M_{t-1} + \gamma F_{t}^{2}
Correlation
R_{m} = \sum_{(i;j)\in S(m)} F_{t}^{2} there
S(m)(i;j)| -(n-1)/2 \le i,j \le (n-1)/2 and i-j = m
References
Murdock, B. B., Smith, D., & Bai, J. (2001). Judgments of frequency and recency in a distributed memory model. Journal of Mathematical Psychology, 45, 564–602. https://doi.org/10.1006/jmps.2000.1339
Examples
o1 <- c(-0.27, -0.24, -0.24, 0.75)
o2 <- c(-0.06, -0.55, 0.66, -0.06)
o3 <- c(0.04, 0.57, -0.65, 0.04)
o4 <- c(0.73, -0.39, -0.20, -0.14)
TODAM2(o1, o2, o3, o4, gamma = rep(c(0.7, 0.8), 5),
alpha = 0.95, sqc = rep(1:4, 4:1))
plot progress of judgment of frequency simulation
Description
plot progress of judgment of frequency simulation
Usage
## S3 method for class 'JoF'
plot(x, type = "l", ...)
Arguments
x |
output of JoF simulation |
type |
"l" for lines, "p" for points, "b" for both |
... |
further arguments |
Value
Displays the judgment of frequency as proportion of all inputs
Output of judgment of frequecny simulation
Description
Output of judgment of frequecny simulation
Usage
## S3 method for class 'JoF'
print(x, ...)
Arguments
x |
output of JoF simulation |
... |
further arguments |
Value
Displays the judgment of frequency as proportion of all inputs