Not sure this approach yields meaningful data, but as a demonstration of
vectorization I got a factor of 10 speedup.
sine.approx3 <- function( tmin, tmax ) {
B <- (2*pi)/24 # period = 24 hours
C <- pi/2 # horizontal shift
tmin <- t( tmin )
tmax <- t( tmax )
idx <- seq.int( 24 * 4 * n
you have received this e-mail in error please contact the sender.
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
> On Behalf Of Ortiz-Bobea, Ariel
> Sent: 13. maj 2014 05:42
> To: r-help@r-project.org
> Subject: [R] efficient sin
You can try this:
http://max2.ese.u-psud.fr/epc/conservation/Girondot/Publications/Blog_r/Entrees/2013/6/4_GLM_with_periodic_(annual)_transformation_of_factor.html
Sincerely,
Marc
Le 13/05/2014 05:42, Ortiz-Bobea, Ariel a écrit :
Hello,
I'm trying to fit a sine curve over successive temperatu
Hello,
I'm trying to fit a sine curve over successive temperature readings (i.e.
minimum and maximum temperature) over several days and for many locations. The
code below shows a hypothetical example of 5000 locations with 7 days of
temperature data. Not very efficient when you have many more
4 matches
Mail list logo