Skip to content

Commit bbd138d

Browse files
committed
spellproof
1 parent fa973b4 commit bbd138d

File tree

8 files changed

+16
-16
lines changed

8 files changed

+16
-16
lines changed

Bayesian_Cognitive_Modeling/ParameterEstimation/DataAnalysis/ChaSaSoon_Stan.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ rm(list=ls())
44
library(rstan)
55

66
#### Notes to Stan model #######################################################
7-
## 1) Approach to this model can be difficult to understand for beginners.
8-
## Therefore I suggest either not trying to understand it and look on WinBUGS
9-
## version or go deep into Stan manual.
7+
## Implementation of this model can be difficult to understand for beginners.
8+
## Therefore I suggest either not trying to understand it and look on WinBUGS
9+
## version or go deep into Stan manual.
1010
################################################################################
1111
model <- "
1212
# ChaSaSoon Censored Data

Bayesian_Cognitive_Modeling/ParameterEstimation/DataAnalysis/ChangeDetection_Stan.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ library(rstan)
99
## you change the values, you'll need to increment iterations significantly
1010
## 2) Code is quite dissimilar to original WinBUGS model - using conditionals
1111
## instead of step function. This will happen in further models more often.
12-
## There are difference in what functions are efficient in BUGS and Stan.
12+
## There is a difference in what functions are efficient in BUGS and Stan.
1313
################################################################################
1414
model <- "
1515
// Change Detection

Bayesian_Cognitive_Modeling/ParameterEstimation/DataAnalysis/Correlation_1_Stan.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ rm(list=ls())
44
library(rstan)
55

66
#### Notes to Stan model #######################################################
7-
## 1) Multivariate normal distribution in Stan uses covariance matrix insted of
7+
## 1) Multivariate normal distribution in Stan uses covariance matrix instead of
88
## precision matrix.
99
## 2) Multivariate normal distribution can be (and is) also vectorized.
1010
## 3) Warnings may occur during sampling, ignore them.

Bayesian_Cognitive_Modeling/ParameterEstimation/DataAnalysis/Correlation_2_Stan.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ rm(list=ls())
44
library(rstan)
55

66
#### Notes to Stan model #######################################################
7-
## 1) All notes from previsou model Correlation_1 also applies to this model.
7+
## 1) All notes from previous model Correlation_1 also apply to this model.
88
## 2) If you change sigmaerror to c(0.03, 10) as suggested in excercise 5.2.2
99
## warning statements will be more frequent and posterior less smooth.
1010
################################################################################

Bayesian_Cognitive_Modeling/ParameterEstimation/DataAnalysis/Kappa_Stan.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ rm(list=ls())
44
library(rstan)
55

66
#### Notes to Stan model #######################################################
7-
## 1) First time we use simplex data type. Simplex is similar to vector, but
8-
## with a property that sum of all it's elements is equal to 1.
7+
## 1) This is the first time we use simplex data type. Simplex is similar to
8+
## vector, but with a property that sum of all it's elements is equal to 1.
99
## 2) Sampling statements for parameters alpha, beta and gamma could be removed
1010
## leading to uniform prior on (0, 1) interval which is the same as beta(1, 1)
1111
## 3) Variable n was removed here. Stan doesn't need this information as
12-
## an argument for multinomial distribution. Always make sure, that you know
12+
## an argument for multinomial distribution. Always make sure that you know
1313
## what arguments are required for a function / sampling statement. In many
1414
## cases these are different from BUGS. Very useful for this are last pages
1515
## of Stan manual

Bayesian_Cognitive_Modeling/ParameterEstimation/DataAnalysis/Planes_Stan.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ library(rstan)
55

66
#### Notes to Stan model #######################################################
77
## Stan has hypergeometric distribution implemented, so in one way the code
8-
## is more intuitive. On the other side, Stan can't sample discrete parameters
8+
## is more intuitive. On the other hand, Stan can't sample discrete parameters,
99
## therefore we have to increment log probability manually (as we did in
1010
## Survey example).
1111
################################################################################

Bayesian_Cognitive_Modeling/ParameterEstimation/Gaussian/Gaussian_Stan.R

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ library(rstan)
55

66
#### Notes to Stan model #######################################################
77
## 1) If parameter's prior distribution is not specified, Stan will assume that
8-
## you want it distributed uniformly with boundaries given by variable
9-
## constraints. Here constrains <lower=0,upper=10> gives uniform(0, 100)
10-
## 2) In Stan most of the sampling statements can be vectorized. In this example
11-
## you can see it in a statement for vector x. Instead of using for loop for
12-
## each element of the vector, we can simple write it as above. Saves code,
8+
## you want it to be distributed uniformly with boundaries given by variable
9+
## constraints. Here constrains <lower=0,upper=10> give uniform (0, 100)
10+
## 2) In Stan, most of the sampling statements can be vectorized. In this example
11+
## you can see it in the statement for vector x. Instead of using for loop for
12+
## each element of the vector, we can simple write it as above. This saves code,
1313
## speeds up computation. For more information read Vectorization chapter in
1414
## the Stan manual (p.231 in version 2.4.0)
1515
################################################################################

Bayesian_Cognitive_Modeling/ParameterEstimation/Gaussian/IQ_Stan.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ library(rstan)
55

66
#### Notes to Stan model #######################################################
77
## 1) We used implicit uniform distribution for sigma and vector mu
8-
## 2) The second loop in this model (1:m) is unnecessary here. You can try to
8+
## 2) The second loop in this model (1:m) is not necessary here. You can try to
99
## remove it, but don't forget to remove its index j. Remember vectorization!
1010
################################################################################
1111
model <- "

0 commit comments

Comments
 (0)