similar to: Calling R functions from C and setting function's formal list values

Displaying 20 results from an estimated 500 matches similar to: "Calling R functions from C and setting function's formal list values"

2005 Dec 21
0
Help with Krige.conv using linear models
A majority of my data makes a kriged map perfectly using an exponential model for the semivariogram to fit my data and then going through the commands variofit() to define the model and then krige.conv() to use the model to predict values in a grid. But?one set of my data appears to be linearly correlated for the first 5000 meters and not correlated beyond that. I have been having problems
2006 Apr 04
1
change function's formals default values
Hello, I'm passing a user defined function into my c code. Once this function is in my c code, I'd like to iteratively change the values associated with the parameters defined in the function's formal list then evaluate the function using these newly set defaults (i.e., using lang1(fn)). My question is, how do I simply change the value associated with each parameter in this
2012 Oct 04
1
geoRglm with factor variable as covariable
Dear R users. I'm trying to fit a generalised linear spatial mode using the geoRglm package. To do so, I'm preparing my data (geodata) as follow: geoData9093 = as.geodata(data9093, coords.col= 17:18, data.col=15,* covar.col=16*) where covar.col is a factor variable (years in this case 90-91-92-93)). Then I run the model as follow: / model.5 = list(cov.pars=c(1,1),
2005 May 19
0
Random/systematic selection of rows in a matrix
Hi R people: I am new to R. I am writing a function to (1) produce a sparse stochastic Gaussian 2D field and (2) perform a systematic transect sampling on this field, this carried out many times in a simulation framework. My function does a good job at producing the random field (a matrix of zeros and some manifestations of the stochastic process, depending on a parameter of the function
2010 Mar 14
3
the error in DoSimulateRF function
Hello, I am a graduate student of University of Florida. I am trying to run a process variation model and I am facing the following error. ------------------------------------------------------------- Analysis of geostatistical data For an Introduction to geoR go to http://www.leg.ufpr.br/geoR geoR version 1.6-27 (built on 2009-10-15) is now loaded
2012 Nov 04
1
Struggeling with nlminb...
Hallo together, I am trying to estimate parameters by means of QMLE using the nlminb optimizer for a tree-structured GARCH model. I face two problems. First, the optimizer returns error[8] false convergence if I estimate the functions below. I have estimated the model at first with nlm without any problems, but then I needed to add some constraints so i choose nlminb.
2011 Mar 03
2
lattice custom axis function -- right side margins
Dear R help list, I have a plot with two different vertical scales that I want to display on either side of the plot. It's quite similar to the Fahrenheit-Centigrade example in the examples section of the documentation for axis.default. The right-side axis is clipped off, though, and I haven't been able to figure out anything with viewport() and clipping or trellis.par.set to fix
2005 Mar 07
3
R crashes using the em function of package mclust (PR#7719)
Hi, I got the same problem like http://tolstoy.newcastle.edu.au/R/devel/04/11/1204.html R crashes when I use the em function from the mclust package on univariate data and on a special case on bivariate data (when the matrix is not provided as written in the manual). It seems as if the problem is the format of the data to be analyzed. Operating System: Windows XP (SP2) R version: R-2.0.1 The
2007 Dec 12
2
problem applying a conditional formula to each element of a matrix
I'm applying a function (Cov.f) defined below to each element of a distance matrix. When I run the code below, I get a warning message (below) and elements of returned matrix [2,3] and [3,2] are not zero as I would expect. Clearly, there is an error... What am I doing wrong? Thanks. --Dale Warning message: In if (h <= phi) { : the condition has length > 1 and only the first element
2010 Sep 22
0
Help with mclust package
Hi, I am trying to run th mclust package on a variable "Tuberculin indurations" recorded as mm. The file has only one variable. When I run the package I get NULL value for mu and sigma. Can anybody say why? This is the program: library("mclust") mc<-Mclust(x.trab,G=1:9,warn=TRUE) mc mc$mu sqrt(mc$sigmasq) and the output I get is > library("mclust")
2005 Oct 21
1
finite mixture model (2-component gaussian): plotting component gaussian components?
Dear Knowledgeable R Community Members, Please excuse my ignorance, I apologize in advance if this is an easy question, but I am a bit stumped and could use a little guidance. I have a finite mixture modeling problem -- for example, a 2-component gaussian mixture -- where the components have a large overlap, and I am trying to use the "mclust" package to solve this problem. I need
2007 Mar 07
2
Power calculation for detecting linear trend
Dear people, I've a problem in doing a power calculation. In Fryer and Nicholson (1993), ICES J. mar. Sci. 50: 161-168 page 164 an example is given with the following characteristics T=5, points in time R=5, replicates Var.within=0.1 q=10, a 10% increase per year The degrees of freedom for the test are calculated as Vl=T*R-2=23 and the non-centrality parameter Dl=4.54. Using this they get a
2005 Oct 22
0
package mclust: cdens, EMclust?
Dear Knowledgeable R Community Members, Please excuse my ignorance -- I apologize in advance if this is an easy question, but I am a bit stumped and could use a little guidance regarding parameters in 2 functions in the "mclust" package. -------------------- PROBLEM DESCRIPTION -------------------- I have a finite mixture modeling problem -- for example, a 2-component gaussian
2007 Feb 22
0
Error in solve.default
I am trying to run the following function (a hierarchical bayes linear model) and receive the error in solve.default. The function was originally written for an older version of SPlus. Can anyone give me some insights into where the problem is? Thanks R 2.4.1 on MAC OSX 2mb ram Mark Grant markg at uic.edu > attach(Aspirin.frame) > hblm(Diff ~ 1, s = SE) Error in solve.default(R, rinv)
2006 Oct 22
1
Getting hold of a package's environment from C code
Hi, I have a package where I'm calling an R function (say "foo") from C code. "foo" is in the same package, but is not exported. I construct the call using lang1(install("foo")), but to eval it I need the package's environment. Is there a way to do this? Passing the correct environment through .Call() is not an option. Right now, I'm getting the
2009 Sep 16
2
I want to get a reference to this time series object
I'm trying to get a reference to this object in C SWX.RET[1:6,c("SBI,"SPI","SII")] While i am able to access and use a plain SWX.RET object, I'm getting confused on how to create an object with the array subscripts like above. Here is what I tried to do. It doesn't work because "[" is obviously not an operation or function on SWX.RET. So how do I
2006 Jan 13
1
help with gepRglm::likfit.glsm
> -----Original Message----- > From: r-help-bounces at stat.math.ethz.ch [SMTP:r-help-bounces at stat.math.ethz.ch] On Behalf Of ernesto > Sent: Friday, January 13, 2006 9:25 AM > To: Mailing List R > Subject: [R] help with gepRglm::likfit.glsm > > Hi, > > I'm exploring likfit.glsm and I need some help. I have to say that I'm > not an MCMC expert ... >
2004 Oct 19
1
Error message in mclust
I keep on receiving the message below after submitting the following line using the mclust package. m2 is a 99 X 1 column vector. * em(modelName = "E", m2, mu = c(25, 50), sigmasq=10, pro = c(0.4, 0.6)) Error in as.double.default(data) : (list) object cannot be coerced to double. Why do I receive this error? Thank, Brian C. Newquist Research Statistician
2004 Oct 19
1
Windows XP crashes when running the EM algorithm in MCLUST
Whenever I submit the following command >result <- em("E", m1, mu=c(25, 50), sigmasq=10, pro=c(0.49,0.51)) in MCLUST , I experience a problem with my Windows XP. Has anyone had this type of problem? I receive the general "send report" dialogue box and my program is no longer able to run. Should I change any of my system settings? Let me know if you think of anything
2009 Oct 08
3
foreach loop - rejection method
Hi Everybody, Thanks in advance for your help. This is my first time using the foreach statement and I cant get it to work properly so here is what i have test<-function(){ repeat { cand2[l-1]<-rinvgamma(1,phi,lambda[l-1]) q2<-dinvgamma(cand2[l-1],phi,lambda[l-1]) p2<-cand2[l-1]^-1.5*exp(-y[l]^2/(2*cand2[l-1]))*exp(-((log(cand2[l-1])-mu_t_cand[l-1])^2)/2*sigmasq)