search for: fscale

Displaying 16 results from an estimated 16 matches for "fscale".

Did you mean: scale
2002 Jul 22
2
typsize and fscale arguments to nlm
Dear R list members, I have a question about the proper use of the typsize and fscale arguments to nlm. I use nlm in my sem package to fit general structural-equation models, which entails maximizing a multinormal likelihood with respect to parameters that represent regression coefficients and covariances of variables. The magnitudes of these parameters can be very different....
2002 Nov 14
0
nlm / fscale
Dear all, I am using the nlm(base) function for a simple least squares problem. The size (order of magnitude) of the minimized function near the final parameter set is normally about 1e-10. Using the fscale=1e-10 argument in nlm is inefficient (no minimization is performed, iterations=0 or 1). Nlm only works when the minimized function is multiplied by 1e10 (without changing the default fscale). Why? How should I use the fscale arg? Thanks! St?phane Pezennec UMR INRA-ENSAR 1055 65, rue de St Bri...
2018 Apr 17
1
Minor glitch in optim()
Having worked with optim() and related programs for years, it surprised me that I haven't noticed this before, but optim() is inconsistent in how it deals with bounds constraints specified at infinity. Here's an example: # optim-glitch-Ex.R x0<-c(1,2,3,4) fnt <- function(x, fscale=10){ yy <- length(x):1 val <- sum((yy*x)^2)*fscale } grt <- function(x, fscale=10){ nn <- length(x) yy <- nn:1 # gg <- rep(NA,nn) gg <- 2*(yy^2)*x*fscale gg } npar <- 4 lower <- -Inf l2 <- rep(-Inf,npar) a1 <- optim(x0, fnt, grt, lower=lower, meth...
2000 Mar 06
1
nlm and optional arguments
...sically copying the R code of nlm() but defining a temporary function that passes the optional arguments to the objective function), but I presume this would be cleaner and faster if implemented at a lower level ... nlm2 <- function(f, p, hessian=FALSE, typsize=rep(1,length(p)), fscale=1, print.level=0, ndigit=12, gradtol=1e-6, stepmax=max(1000 * sqrt(sum((p/typsize)^2)), 1000), steptol=1e-6, iterlim=100, check.analyticals=TRUE, ...) { tmpf <- function(x) { f(x,...) } nlm(tmpf,p,hessian=hessian,typsize=typsize,fscale=fscale,print.level...
2010 Oct 13
1
Wierd nlm behaviour in 2.10.1 and 2.12.0 [Sec=Unclassified]
...nally narrowed it to a call to nlm(). This can be replicated by: FixedRemovals<-1836180125888 AbStageInitial<-2223033830403 Rates<- 0.3102445 nlm(function(rootM,Abund,Loss,OtherM) {(Loss-(rootM/(rootM+OtherM)* (1-exp(-(rootM+OtherM)))* Abund))^2} ,0.001,print.level=0,fscale=0, gradtol=1E-10, stepmax = 100.0 ,Loss=FixedRemovals ,Abund=AbStageInitial ,OtherM=Rates)$estimate ___________________________________________________________________________ Australian Antarctic Division - Commonwealth of Australia IMPORTANT: This transmission is intended for...
2008 Jan 15
1
Viewing source code for .Internal functions
I am trying to view the source code of the function nlm in the stats package of R 2.4.1. I downloaded the source from CRAN and opened nlm.R, and it calls a .Internal function: .Internal(nlm(function(x) f(x, ...), p, hessian, typsize, fscale, msg, ndigit, gradtol, stepmax, steptol, iterlim)) This is the same thing I saw when entering the function name at the R command prompt. Where will I find the actual code? Thanks.
2007 Jun 20
1
How to use "mix" to estimate the parameters for mixture gamma distribution?
...;gamma" mixture distribution to estimate the parameters. Here is what I am using for the "mix" function. Test<-mix(x, mixparam(mu=c(1,125),sigma=c(1,11.18)),"gamma") However, one error message shows up as: "Error in nlm(function(x) f(x, ...), p, hessian, typsize, fscale, msg, : missing value in parameter" Does anybody know what that means and how to fix it to get the estimation? Your help will be much appreciated. Yun ============================================== Yun Wang Research Assistant Department of Family Medicine and Public Health Sciences Wayne...
2005 Oct 11
2
Sometimes having problems finding a minimum using optim(), optimize(), and nlm() (while searching for noncentral F parameters)
...2=df.2) # Try to accomplish the same task with a different R function. optimize(f=Low.Lim.NC.F, lower=LL.0, upper=50, maximum=FALSE, tol=tol, alpha.lower=alpha.lower, F.value=F.value, df.1=df.1, df.2=df.2) # Try to accomplish the same task with a different R function. nlm(f=Low.Lim.NC.F, p=LL.0, fscale=1, print.level = 0, ndigit=12, gradtol = 1e-6, stepmax = max(1000 * sqrt(sum((LL.0/10)^2)), 1000), steptol = 1e-6, iterlim = 1000, check.analyticals = TRUE, alpha.lower=alpha.lower, F.value=F.value, df.1=df.1, df.2=df.2) # The answer in each case is 3.0725. Thus, a noncentral F with # 5 and 200 d...
2009 Jun 16
4
confusion on levels() function, and how to assign a wanted order to factor levels, intentionally?
...ards, Mao J-F data, code, and results I used and got are as followed: (You can find that the correlations of the factor and the numeric variables changed, before and after the levels() was performed.) > d<-read.delim("All.txt",header=T) > d species population conlen tscale fscale tseen w100s nfsee 1 Py YXPy01 8.60 153 69 111 1.680851 94 2 Py YXPy01 8.10 173 74 139 1.848485 133 3 Py YLPy01 6.50 138 58 99 1.520833 48 4 Py YLPy01 5.90 153 67 118 1.355140 107 5 Py KMPy01...
2009 Jun 15
1
How to do automatical-plotting
...dataframe: All, group variable: species and popluation, and numeric variable: conlen) is as followed: pcon<-ggplot(All, aes(population,conlen)) pcon+geom_boxplot(aes(fill=species)) Thank you in advance. Regards Mao J-F a part of my dataframe: All species population conlen tscale fscale tseen w100s nfsee Py YXPy01 8.6 153 69 111 1.680851064 94 Py YXPy01 8.1 173 74 139 1.848484849 133 Py YLPy01 6.5 138 58 99 1.520833333 48 Py YLPy01 5.9 153 67 118 1.355140187 107 Py KMPy01 6.1 113...
2000 Dec 07
0
Tuning the nlm function
Hi Everyone, Is there a simple way to force nlm to take larger initial steps? Setting print.level = 2 allows me to inspect the step size at each iteration, but I appear not to have made any appreciable impact on it by changing values of typsize, fscale, steptol or stepmax. The steps repeatedly come out tiny, 1e-9 typically, and the algorithm is terminating not because the gradient is zero (it is not, according to the numerical values) but because the function value is not changing between iterations. Am I missing something obvious? Many thanks...
2004 Aug 21
0
Convergence code in nlm function
...h to the true values in most of cases. I tried to change the optional parameters in the nlm call but this does not help to achieve code=1. What may be a reason for such situation? Could I think that the obtained estimates are what I am looking for? I am using R 1.9.1: nlm(N.Loglik,initial.values,fscale=1,print.level = 1, gradtol = 1e-6,steptol = 1e-6,iterlim = 500,y=y) Much thanks, Victoria. [[alternative HTML version deleted]]
2001 Nov 25
2
another optimization question
Dear R list members, Since today seems to be the day for optimization questions, I have one that has been puzzling me: I've been doing some work on sem, my structural-equation modelling package. The models that the sem function in this package fits are essentially parametrizations of the multinormal distribution. The function uses optim and nlm sequentially to maximize a multinormal
2011 Dec 15
10
fsincos emulation on AMD CPUs
All, in the light of erratum #573 I''m wondering if we need to tweak or conditionally suppress fsincos emulation. The question is whether there is any possibility for getting the emulator to hit this instruction on AMD (as no real mode emulation ought to be taking place there), i.e. whether there are places where emulation gets continued eagerly in anticipation of the need for emulation
2006 Apr 12
1
powerd not behaving with an Asus A8V-MX and Athlon 64 X2 3800+
...rn.malloc_count: 204 kern.ident: SMP-GENERIC kern.maxusers: 384 kern.fallback_elf_brand: -1 kern.kstack_pages: 2 kern.sync_on_panic: 0 kern.shutdown.poweroff_delay: 5000 kern.shutdown.kproc_shutdown_wait: 60 kern.sugid_coredump: 0 kern.coredump: 1 kern.nodump_coredump: 0 kern.corefile: %N.core kern.fscale: 2048 kern.timecounter.stepwarnings: 0 kern.timecounter.nbinuptime: 38248 kern.timecounter.nnanouptime: 0 kern.timecounter.nmicrouptime: 629 kern.timecounter.nbintime: 518 kern.timecounter.nnanotime: 5 kern.timecounter.nmicrotime: 513 kern.timecounter.ngetbinuptime: 498 kern.timecounter.ngetnanoupt...
2001 Feb 17
4
Comments on R-1.2.1 builds (PR#851)
...-------------------------- c89 -I. -I../../src/include -I../../src/include -I/usr/local/include -DHAVE_CONFIG_H -OPT:IEEE_NaN_inf=ON -g -c uncmin.c -o uncmin.o cc-1551 c89: WARNING File = uncmin.c, Line = 2443 The variable "mxtake" is used before its value is set. steptl, sx, fscale, itnlim, iretcd, mxtake, msg); ^ ------------------------------------------------------------------------ DIRECTORY: R-1.2.1/src/nmath c89 -I. -I../../src/include -I../../src/include -I/usr/local/include -DHAVE_CONFIG_H -OPT:IEEE_NaN_inf=ON -g -c polyg...