mewAccum | R Documentation |
mewTyp
Update an S4 object of class mewTyp
with a new
data point
mewAccum(xx, av)
xx |
(vector double) The vector of data with which to update the MEW aveage |
av |
(class mewTyp) The current state of the MEW average |
If av
is an S4 object of class mewTyp
that
contains the current state of the MEW average and xx
is a
new vector of data, the function mewAccum
updates the MEW
average with xx
.
The updated instance of av
n_iter <- 1000 av <- mewInit(n_bin = 4, n_xx = 1, ff = 0.5) for (i in 1:n_iter) { value <- runif(n=2) value[1] <- ((cos(value[1]*2*pi))^2)*(1 - exp(-0.01*i)) value[2] <- (-((sin(value[2]*2*pi))^2))*(1 - exp(-0.01*i)) value <- as.double(value) av <- mewAccum(xx = value, av = av) }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.