search for: fncount

Displaying 9 results from an estimated 9 matches for "fncount".

Did you mean: pfncount
2006 Apr 13
1
bus error on calling nmmin
...double value; int convergenceCode; const double abstol = 1e-16; const double reltol = 1e-8; const double alpha = 1.0; /* reflection factor */ const double beta = 0.5; /* contraction factor */ const double gamm = 2.0; /* expansion factor */ const int trace = 4; /* tracing on */ int fncount; const int maxit = 10000; nmmin(1, initial, result, &value, parabola, &convergenceCode, abstol, reltol, NULL, alpha, beta, gamm, trace, &fncount, maxit); printf("fncount: %d\n", fncount); printf("convergence code: %d\n", convergenceCode); printf("...
2007 Oct 13
1
R API - optim
...the help * page for optim. */ const double abstol = 1e-16; const double reltol = 1e-8; const double alpha = 1.0; /* reflection factor */ const double beta = 0.5; /* contraction factor */ const double gamm = 2.0; /* expansion factor */ const int trace = 0; /* tracing on */ int fncount; const int maxit = 10000; Rf_initEmbeddedR(argc, argv); nmmin(1, initial, result, &value, parabola, &convergenceCode, abstol, reltol, NULL, alpha, beta, gamm, trace, &fncount, maxit); printf("fncount: %d\n", fncount); printf("convergen...
2008 Mar 07
1
parameters for lbfgsb (function for optimization)
Can anyone help me with lbfgsb (function for optimization)? It takes the following parameters: void lbfgsb (int n, int lmm, double *x, double *lower, double *upper, int *nbd, double *Fmin, optimfn fn, optimgr gr, int *fail, void *ex, double factr, double pgtol, int *fncount, int *grcount, int maxit, char *msg, int trace, int nREPORT); What do I put for parameter ex (11th parameter)? I looked at optim.c codes at R sites and it's a structure that has bunch of objects such as SEXP R_fcall, SEXP R_gcall, SEXP R_env, double* ndeps, etc. I cannot figure out what it is...
2006 Mar 29
1
calling R's optimization routines from C
...e *X = mydata->X; int n = mydata->n; double mu = par[0]; double sum = 0.0; int i; for (i=0; i<n; i++) { double t = X[i] - mu; sum += t*t; } return sum; } int main(void) { int i,n=1, trace=1, maxit=100, fail, fncount; double *par, abstol=0.0001, intol=.0001, alpha=1, beta=.5, gamma=2, *xin, *x, Fmin; MyData ex; par=malloc(n*sizeof(double)); xin=malloc(n*sizeof(double)); x=malloc(n*sizeof(double)); par[0]=5; xin[0]=5; ex.n=5; ex.X=malloc(ex.n*sizeof(double)); for(i=0;i<ex.n;i++) ex...
2012 Oct 28
0
lbfgsb from C
...ouble *par, double *gr, void *ex) { gr[0] = 2*par[0]; gr[1] = 2*par[1]; } int main(void) { int n = 2; int m = 5; double init[] = {2,3}; double lower[] = {-100, -100}; double upper[] = {100, 100}; int nbd[] = {0, 0}; double Fmin; int fail; void *ex = 0; double factr = 1e7; double pgtol = 0; int fncount; int grcount; int maxit = 10; char msg[1000]; int trace = 0; int nREPORT = 10; /* from http://cran.r-project.org/doc/manuals/R-exts.html#Optimization void lbfgsb(int n, int lmm, double *x, double *lower, double *upper, int *nbd, double *Fmin, optimfn fn,...
2008 Oct 31
0
R help for invoking nmmin()
...tempX[j][i] * betaFn[i]; } total += pow(tmp->tempY[j] - temp,2); } return total; } void mgr(int, double *, double *, void *){} int main() { //cout<<pchisq(2,7,1,0)<<endl; //cout << qnorm(0.7, 0.0, 1.0, 0, 0) << endl; int n = 5; double *dpar, *opar; int fncount, fail; dpar = new double [n]; opar = new double [n]; dpar[0] = 13.67318; dpar[1] = 0; dpar[2] = 17.02707; dpar[3] = 0; dpar[4] = 24.08231; double value; double abstol = 1e-16; double intol = 1e-8; int y = 12; MM t = (MM)malloc(y*(n+2)*sizeof(TT)); t-> tempX = new double * [y]; fo...
2012 Jun 08
0
Working with optim in C
...oid *ex) { for(int i = 0; i < n; i++) { gr[i] = log(par[i]) - log(1-par[i]); } } void Test(SEXP SomeValues) { PROTECT(SomeValues = AS_NUMERIC(SomeValues)); double * CValues = NUMERIC_POINTER(SomeValues); void * optEx, *grEx, *overallEx; int mask = -1, fncount, grcount, failed; double *Fmax, *gradients; int size = sizeof(CValues)/sizeof(double); vmmin(size, CValues, Fmax, optimfn, optimgr, 20, 0, mask, .00001, .000001, 40, overallEx, fncount, grcount, failed); } !~...
2007 Oct 23
0
API for optimization with Simulated annealing
...ble *, void *); +typedef void sagenptry(int, double *, double *, double, void *); void vmmin(int n, double *b, double *Fmin, optimfn fn, optimgr gr, int maxit, int trace, @@ -82,8 +83,8 @@ double *Fmin, optimfn fn, optimgr gr, int *fail, void *ex, double factr, double pgtol, int *fncount, int *grcount, int maxit, char *msg, int trace, int nREPORT); -void samin(int n, double *pb, double *yb, optimfn fn, int maxit, - int tmax, double ti, int trace, void *ex); +void samin(int n, double *pb, double *yb, optimfn fn, sagenptry *new_candidate, + int maxit, int tmax, double...
2008 Oct 03
1
Memory crash
...give the output below. Can this be an R bug? I suspect it has to do with repeated calls to 'vmmin' like this: for (...){ vmax = vmaxget(); vmmin(*p, b, &Fmin, bfun, bfun_gr, *maxit, *trace, mask, abstol, reltol, nREPORT, ext, &fncount, &grcount, &fail); vmaxset(vmax); ... } but I am only guessing. Any suggestions? Ubuntu 8.04, R-2.7.2. G?ran ------------------------------------------------------------------- > glmmboot(y ~ x, cluster = cluster, data = res$dat, family = binomial, bo...