@@ -34,7 +34,7 @@ Specificly i re sample the reward if it is over 120. Now, as you may see below,
...
@@ -34,7 +34,7 @@ Specificly i re sample the reward if it is over 120. Now, as you may see below,
I am not really happy with that because now, the normative solution is to seek out variance and the story about risk taking is that there is no such normative solution isnt it?
I am not really happy with that because now, the normative solution is to seek out variance and the story about risk taking is that there is no such normative solution isnt it?
```{r fig.width=12,fig.height=6}
```{r fig.width=12,fig.height=6}
library("viridis")
envirionmentMeanKids=seq(-50,50,length.out=5)#define the range of kid envirionemt
envirionmentMeanKids=seq(-50,50,length.out=5)#define the range of kid envirionemt
envirionmentVarianceKids=seq(1,10,length.out=5)
envirionmentVarianceKids=seq(1,10,length.out=5)
EnvirionemntKids=expand.grid(Mean=envirionmentMeanKids,Variance=envirionmentVarianceKids)# we sample from this later
EnvirionemntKids=expand.grid(Mean=envirionmentMeanKids,Variance=envirionmentVarianceKids)# we sample from this later
Here i define the kalman filter and the choice rule.
Here i define the kalman filter and the choice rule.
The Kalman Agent explores the bandits by representing their mean reward rate and its uncertainty about that mean. Both, beliefs about the mean reward rate and uncertainty about that belief are updated every iteration after observing a new outcome. The Agents behavior can be gouverend by 3 parameters:
The Kalman Agent explores the bandits by representing their mean reward rate and its uncertainty about that mean. Both, beliefs about the mean reward rate and uncertainty about that belief are updated every trials after observing a new outcome. The Agents behavior can be gouverend by 3 parameters:
* mu0, or Optimism: its prior assumption about how rewarding the envirionment will be on average. This Paramter will also gouvern the extend of exploration
* mu0, or Optimism: its prior assumption about how rewarding the envirionment will be on average. This Paramter will also gouvern the extend of exploration
...
@@ -97,7 +96,7 @@ bayesianMeanTracker <- function(x, y, theta, prevPost=NULL,mu0Par,var0Par){
...
@@ -97,7 +96,7 @@ bayesianMeanTracker <- function(x, y, theta, prevPost=NULL,mu0Par,var0Par){
mutate(newC = ifelse(cumDens == 1 & lag(cumDens)==0, 1, 0))->newExp# if i take the derivative of this this might be exaclty what wouter was intersted in.
mutate(newC = ifelse(cumDens == 1 & lag(cumDens)==0, 1, 0))->newExp# if i take the derivative of this this might be exaclty what wouter was intersted in.
newExp[is.na(newExp$newC),]$newC=1#
newExp[is.na(newExp$newC),]$newC=1#
#now i have to "reset" so that each trial there can only be one new decision and because otherwise this will scale up the cumulative sum too much
#now i have to "reset" so that each trial there can only be one new decision and because otherwise this will scale up the cumulative sum too much