Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdeaabd4

Browse files
Extend and rename readme
1 parent2811fdd commitdeaabd4

File tree

3 files changed

+97
-20
lines changed

3 files changed

+97
-20
lines changed

‎README.md‎

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<!-- README.md is generated from README.Rmd. Please edit that file-->
2+
PCSinR
3+
======
4+
5+
**The PCSinR package contains all necessary functions for building and simulation Parallel Constraint Satisfaction (PCS) network models within R.**
6+
7+
PCS models are an increasingly used framework throughout psychology: They provide quantitative predictions in a variety of paradigms, ranging from word and letter recognition, for which they were originally developed (McClelland & Rumelhart, 1981; Rumelhart & McClelland, 1982), to complex judgments and decisions (Glöckner & Betsch, 2008; Glöckner, Hilbig, & Jekel, 2014), and many other applications besides.
8+
9+
Installation
10+
------------
11+
12+
- The current stable version is available via CRAN, and can be installed by running`install.packages("PCSinR")`.
13+
- You can install the latest development version directly from GitHub with the`devtools` package. To do so, please run`devtools::install_github("felixhenninger/PCSinR@master")`.
14+
15+
Usage
16+
-----
17+
18+
The functions in this package simulate a PCS network, given an interconnection matrix. Methods for creating such a matrix from the most common models are forthcoming.
19+
20+
Once a connection matrix has been specified, the model can be simulated easily using the most common parameter set.
21+
22+
```r
23+
require(PCSinR)
24+
#> Loading required package: PCSinR
25+
26+
interconnections<-matrix(
27+
c(0.0000,0.1015,0.0470,0.0126,0.0034,0.0000,0.0000,
28+
0.1015,0.0000,0.0000,0.0000,0.0000,0.0100,-0.0100,
29+
0.0470,0.0000,0.0000,0.0000,0.0000,0.0100,-0.0100,
30+
0.0126,0.0000,0.0000,0.0000,0.0000,0.0100,-0.0100,
31+
0.0034,0.0000,0.0000,0.0000,0.0000,-0.0100,0.0100,
32+
0.0000,0.0100,0.0100,0.0100,-0.0100,0.0000,-0.2000,
33+
0.0000,-0.0100,-0.0100,-0.0100,0.0100,-0.2000,0.0000 ),
34+
nrow=7
35+
)
36+
37+
result<- PCS_run_from_interconnections(interconnections)
38+
```
39+
40+
A common simulation result concerns the number of iterations needed until convergence is reached.
41+
42+
```r
43+
result$convergence
44+
#> default
45+
#> 116
46+
```
47+
48+
The output also contains a log of the model states across all iterations. Here, we examine just the final state.
49+
50+
```r
51+
result$iterations[nrow(result$iterations),]
52+
#> iteration energy node_1 node_2 node_3 node_4 node_5 node_6 node_7
53+
#> 117 116 -0.2916358 1 0.5293124 0.3669084 0.1906411 -0.07023219 0.5477614 -0.5477614
54+
```
55+
56+
General Information
57+
-------------------
58+
59+
The`PCSinR` package is developed and maintained by Felix Henninger. It is published under the GNU General Public License (version 3 or later). The[NEWS file](NEWS.md) documents the most recent changes.
60+
61+
This work was supported by the University of Mannheim’s Graduate School of Economic and Social Sciences, which is funded by the German Research Foundation.

Readme.rmd renamed to README.rmd

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ knitr::opts_chunk$set(
1313
comment = "#>",
1414
fig.path = "README-"
1515
)
16+
options(width = 100)
1617
```
1718

1819
#PCSinR
@@ -27,6 +28,41 @@ PCS models are an increasingly used framework throughout psychology: They provid
2728
* You can install the latest development version directly from GitHub with the`devtools` package.
2829
To do so, please run`devtools::install_github("felixhenninger/PCSinR@master")`.
2930

31+
##Usage
32+
33+
The functions in this package simulate a PCS network, given an interconnection matrix. Methods for creating such a matrix from the most common models are forthcoming.
34+
35+
Once a connection matrix has been specified, the model can be simulated easily using the most common parameter set.
36+
37+
```{r}
38+
require(PCSinR)
39+
40+
interconnections <- matrix(
41+
c( 0.0000, 0.1015, 0.0470, 0.0126, 0.0034, 0.0000, 0.0000,
42+
0.1015, 0.0000, 0.0000, 0.0000, 0.0000, 0.0100, -0.0100,
43+
0.0470, 0.0000, 0.0000, 0.0000, 0.0000, 0.0100, -0.0100,
44+
0.0126, 0.0000, 0.0000, 0.0000, 0.0000, 0.0100, -0.0100,
45+
0.0034, 0.0000, 0.0000, 0.0000, 0.0000, -0.0100, 0.0100,
46+
0.0000, 0.0100, 0.0100, 0.0100, -0.0100, 0.0000, -0.2000,
47+
0.0000, -0.0100, -0.0100, -0.0100, 0.0100, -0.2000, 0.0000 ),
48+
nrow=7
49+
)
50+
51+
result <- PCS_run_from_interconnections(interconnections)
52+
```
53+
54+
A common simulation result concerns the number of iterations needed until convergence is reached.
55+
56+
```{r}
57+
result$convergence
58+
```
59+
60+
The output also contains a log of the model states across all iterations. Here, we examine just the final state.
61+
62+
```{r}
63+
result$iterations[nrow(result$iterations),]
64+
```
65+
3066
##General Information
3167

3268
The`PCSinR` package is developed and maintained by Felix Henninger. It is published under the GNU General Public License (version 3 or later). The[NEWS file](NEWS.md) documents the most recent changes.

‎Readme.md‎

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp