search for: hmax

Displaying 8 results from an estimated 8 matches for "hmax".

Did you mean: hmac
2016 Apr 20
1
Use multiple cores on Linux
...ch as Rmpi/snow/doParallel? Thank you! ##################### library(data.table) library(mgcv) library(reshape2) library(dplyr) library(tidyr) library(lubridate) library(DataCombine) # gam_max_count_wk <- gam(count_pop ~ factor(citycode) + factor(year) + factor(week) + s(lnincome) + s(tmax) + s(hmax),data=cont,na.action="na.omit", method="ML") # # Historic temp_hist <- read.csv("/work/sd00815/giss_historic/giss_temp_hist.csv") humid_hist <- read.csv("/work/sd00815/giss_historic/giss_hum_hist.csv") # temp_hist <- as.data.table(temp_hist) humid_h...
2008 Apr 09
3
LSODA not accurate when RK4 is; what's going on?
I'm solving the differential equation dy/dx = xy-1 with y(0) = sqrt(pi/2). This can be used in computing the tail of the normal distribution. (The actual solution is y(x) = exp(x^2/2) * Integral_x_inf {exp(-t^2/2) dt} = Integral_0_inf {exp (-xt - t^2/2) dt}. For large x, y ~ 1/x, starting around x~2.) I'm testing both lsoda and rk4 from the package odesolve. rk4 is accurate using step
2007 Dec 12
0
Hep on using GAM() in R
..., are there any problem with the codes that i used? What does these warnings mean? Q2: As we know, the span is an important role for smoothing, so i try to choose the optimal span by the AIC criterion. But it seemed that i can't run it successfully, My codes are listed below. hmin<-0.05; hmax<-0.95; hstart<-hmin; nh<-100 hstep<-(hmax-hmin)/(nh-1) aic.h<- matrix(NA,nrow=nh,ncol=2) for (i in 1:nh) { htry<-hstart+(i-1)*hstep m.gam <-gam(mark~lo(x,y,span=htry)+lo(lstday2004,span=htry)+lo(slope,span=htry)+lo(ndvi2004,span=htry)+lo(elevation,span=htry)+disbinary,fam...
2004 Oct 06
1
Foreign code problem
Hello, I wanted to test the odesolve package and tried to use compiled C-code. But when I do: erg <- lsoda(y, times, "mond", parms, rtol, atol, tcrit=NULL, jacfunc=NULL, verbose=FALSE, dllname="mond", hmin=0, hmax=Inf) I get the error message: Error in lsoda(y, times, "mond", parms, rtol, atol, tcrit = NULL, jacfunc = NULL, : Unable to find mond in mond The C code is: #include <math.h> void mond(long int *neq, double *t, double *y, double *ydot) { doubl...
2005 Jul 27
4
odesolve/lsoda differences on Windows and Mac
Hi - I am getting different results when I run the numerical integrator function lsoda (odesolve package) on a Mac and a PC. I am trying to simulating a system of 10 ODE's with two exogenous pulsed inputs to the system, and have had reasonably good success with many model parameter sets. Under some parameter sets, however, the simulations fail on the Mac (see error message below). The
2000 Sep 11
0
SAMPLS R implementation : pbm with algorithm application
...x* is for the quantities for one sample (y* is the response predicted from the model derived; i used one to test my R traduction compared to the R pls module ) Calculate the covariance matrix C=XXT and c*=Xx* for prediction y is centered and become y1 y*1=0 For h =1,2,3...hmax s=Cyh center s working scalar for prediction sample s*=c*Tyh orthogonalize s to previous t: for g=1,...(h-1), s=s-(tgTs/tgTtg)tg orthogonalize s* to previous t*: for g=1,...(h-1), s*=s*-(tgTs/tgTtg)t*g t*h=s* th=s th2=tTt...
2004 Jun 10
0
lsoda with arbitrary zero thresholds (with psuedo-solution)
...* y[2]*y[3] > if(y[3] < .4) yd3 <- -y[3] ### These if,else statements are new > else yd3 <- p["k3"] * y[2]^2 > list(c(yd1,-yd1-yd3,yd3),c(massbalance=sum(y))) > } > out <- lsoda(c(.5,0,.5),times,lsexamp, parms, rtol=1e-4, atol= my.atol, > hmax=.1) > matplot(out[,1],out[,2:5], type="l") > out[dim(out)[1],] # The intent of my could was to cause population 1 to > fall to zero as soon as it reached < 0.4. However, the populations 1 > and 2 reach approximations of 0 (4e-281 and 5e-11). > So, I have two questions:...
2007 Jun 06
3
Using odesolve to produce non-negative solutions
Hello, I am using odesolve to simulate a group of people moving through time and transmitting infections to one another. In Matlab, there is a NonNegative option which tells the Matlab solver to keep the vector elements of the ODE solution non-negative at all times. What is the right way to do this in R? Thanks, Jeremy P.S., Below is a simplified version of the code I use to try to do this,