rnoise.Rd
A noise generator
number of iterations
an FLQuant
standard error for simulated series
autocorrelation parameter a real number in [0,1]
gets rid of 1st values i series
get rid of values > abs(trunc)
returns time series for year, cohort or age"
any other parameters
A FLQuant
with autocorrelation equal to B.
Ranta and Kaitala 2001 Proc. R. Soc. vt = b * vt-1 + s * sqrt(1 - b^2) s is normally distributed random variable with mean = 0 b is the autocorrelation parameter
if (FALSE) {
flq=FLQuant(1:100)
white <- rnoise(1000,flq,sd=.3,b=0)
plot(white)
acf(white)
red <- rnoise(1000,flq,sd=.3,b=0.7)
plot(red)
acf(red)
data(ple4)
res=rnoise(1000,flq,sd=.3,b=0)
ggplot()+
geom_point(aes(year,age,size= data),
data=subset(as.data.frame(res),data>0))+
geom_point(aes(year,age,size=-data),
data=subset(as.data.frame(res),data<=0),colour="red")+
scale_size_area(max_size=4, guide="none")+
facet_wrap(~iter)
res=rnoise(4,m(ple4),burn=10,b=0.9,cohort=TRUE)
ggplot()+
geom_point(aes(year,age,size= data),
data=subset(as.data.frame(res),data>0))+
geom_point(aes(year,age,size=-data),
data=subset(as.data.frame(res),data<=0),colour="red")+
scale_size_area(max_size=4, guide="none")+
facet_wrap(~iter)
}