R/add_noise.R

Defines functions add_noise

Documented in add_noise

add_noise <-
function(data_theta_Ts){
	## Add heteroscedastic noise to simulations
	temp <- cbind(data_theta_Ts[,1], matrix(rnorm(n = (ncol(data_theta_Ts) - 1) * nrow(data_theta_Ts), mean = as.numeric(data_theta_Ts[,-1]), sd = sqrt(0.01 + 0.04 * as.numeric(data_theta_Ts[,-1])^2 ) ), nrow(data_theta_Ts), ncol(data_theta_Ts) - 1 ) )
	dimnames(temp) <- dimnames(data_theta_Ts)
	temp
}

Try the pauwels2014 package in your browser

Any scripts or data that you put into this service are public.

pauwels2014 documentation built on May 1, 2019, 6:29 p.m.