[R] Difficulty coding time-forced functions in deSolve

2014-04-01 Thread Aimee Kopolow
Hi all, I'm trying to use deSolve to solve a series of differential equations with rk4 mimicking a SEIR model, while including an event/function that is not solely time-dependent. Explicitly: I want to introduce vaccination 7 days after the proportion of I2/N2 reaches 0.01. Here is the code I

[R] kNNimpute error

2013-04-12 Thread Aimee Kopolow
Hi all, I'm trying to use kNNimpute in the imputation package to fill in missing precipitation data for a data frame I have. Example is: okee: Date rainfall 1997-05-010 1997-05-020 1997-05-03NA 1997-05-04

[R] calculating number of peaks from acf

2013-04-09 Thread Aimee Kopolow
Hi, Is there a way to calculate the number of peaks produced when running acf on time series data? What I'm looking for is a way to calculate the number of peaks that are greater than the confidence limits if the lag is preset and constant. thanks for any help you are able to give, Aimee.

[R] Error with epiR and sensitivity

2013-03-14 Thread Aimee Kopolow
r" I then tried 'sensitivity' with the syntax zz<-pcc(samplevalues, r1). I didn't get any error messages, but print(zz) only reveals the Call value, and no information. Any advice on what could be the problem?? thank you, Aimee Kopolow __

[R] saving vector output as numeric

2013-03-12 Thread Aimee Kopolow
Hi everybody, I'm trying to create a numerical data frame on which to perform PRCC. So far I have created a data frame that consists of function/vector output that displays in numerical form, but when I try and run PRCC (from epiR package) I get the following error message: "Error in solve.defau

[R] latin hypercube sampling

2013-02-19 Thread Aimee Kopolow
Hi all, I am attempting to use latin hypercube sampling to sample different variable functions in a series of simultaneous differential equations. There is very little code online about lhs or clhs, so from different other help threads I have seen, it seems I need to create a probability density f

Re: [R] Filling matrix elements with a function

2012-11-06 Thread Aimee Kopolow
Hi Jessica and Jim, Thanks for the feedback, Jessica: currently I am defining the functions as the same, but they will be altered at some point soon. Also, I figured that defining the matrix elements as functions would give a dual possibility to the matrix entry depending on the conditions (i.e. o

[R] Filling matrix elements with a function

2012-11-05 Thread Aimee Kopolow
Hi all, I have a matrix simulating migration in a spatial model. I want to be able to define movement (the values of m1, m2 and m3) as only != 0 between adjacent patches and contingent on certain conditions as defined in the function. Here is the code: WET<-function(t) {everglades$precipitation