randomwalk | R Documentation |
This function generates random reward probabilities for the whole experiment
randomwalk(
Narms = 2,
Ntrials = 100,
tau = 0.02,
rho = 0,
upper.bound = 0.85,
lower.bound = 0.15,
plot = TRUE,
save_csv = TRUE
)
Narms |
Number of bandit arms, Default: 2 |
Ntrials |
Number of trials, Default: 100 |
tau |
Standard deviation for the noise normal distribution of each arm, Default: 0.02 |
rho |
True correlation between all arms. default should be zero, Default: 0 |
upper.bound |
Maximal limit of reward probability, Default: 0.85 |
lower.bound |
Minimal limit of reward probability, Default: 0.15 |
plot |
Whether to plot the bandits |
save_csv |
Whether to save the csv for your experiment |
The randomwalk function is responsible for generating the rewards in your experiment. Each arm has a different reward probability and it drifts along the experiment. The rational behind the drift is to maintain learning.
Returns a matrix (Ntrials X Narms) showing the reward probabilities in each trial.
mvrnorm
## Not run:
{
R=
randomwalk(Narms=4,
Ntrials=50,
tau =.02,#standard deviation for the noise normal distribution of each arm
rho =0, #true correlation between all arms. default should be zero
upper.bound =0.85,
lower.bound =0.15)
#check correlations
cor(R)
}
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.