Displaying 19 results from an estimated 19 matches for "ndep".
Did you mean:
dep
2008 Jul 05
3
Editing the "..." argument
...aking the ... arguments that one user can pass in my
function for fitting a model. More precisely, my objective function is
(really) problematic to optimize using the "optim" function.
Consequently, I'd like to add in the "control" argument of the latter
function a "ndeps = rep(something, #par)" and/or "parscale = something"
if the user has not specified it already.
Do you know a way to deal with this point?
In advance, thanks.
Mathieu
--
Institute of Mathematics
Ecole Polytechnique F?d?rale de Lausanne
STAT-IMA-FSB-EPFL, Station 8
CH-1015 Lausa...
2007 Jul 27
1
R codes for g-and-h distribution
hi!
I would like to ask help how to generate numbers from g-and-h distribution. This distribution is like normal distribution but span more of the kurtosis and skewness plane. Has R any package on how to generate them?
Any help will be greatly appreciated. Thank you so much!
Form,
Filame Uyaco
---------------------------------
[[alternative HTML version deleted]]
2004 Sep 13
2
Problem with mle in stats4 (R 1.9.1)
...17, 13, 12, 20, 5, 9, 8, 5, 4, 8)
ll <- function(ymax=15, xhalf=6)
-sum(stats::dpois(y, lambda=ymax/(1+x/xhalf), log=TRUE))
(fit <- mle(ll))
plot(profile(fit), absVal=FALSE)
everything works fine. Now run
(fit <- mle(ll, method="BFGS", control=list(ndeps=c(1e-3, 1e-3))))
plot(profile(fit), absVal=FALSE)
and you will get
Error in interpSpline.default(obj[[i]]$par.vals[, i], obj[[i]]$z,
na.action = na.omit) :
only 0's may mix with negative subscripts
This happens because optim gets the old ndeps but just one variable to
optimize...
2008 Feb 08
0
scaling and optim
...at, suppose I think that
f(x)-f(x1) approx equals f(x)-f(x2) where
x1[1] = x[1] + 10 and
x2[2] = x[2] + 1, and x, x1, and x2 are otherwise equal.
Does this mean I should have parscale = c(10, 1) or parscale= (1/10, 1)?
Since I'm not sure about parscale, I'm really not sure about
'ndeps' A vector of step sizes for the finite-difference
approximation to the gradient, on 'par/parscale' scale.
Defaults to '1e-3'.
So, if I don't do any other rescaling, I might say
ndeps=c(1e-2, 1e3)
in the previous example (response to x[1] is 10 times flat...
2012 Nov 15
1
hessian fails for box-constrained problems when close to boundary?
...Error in optim(c(10, 1), fn = LLNorm, method = "L-BFGS-B", lower = c(-Inf,
: non-finite finite-difference value [2]
The only solution/workaround I found is to do a two steps procedure: use
optim() without hessian, then use optimHess, specifying the length of the
numerical variations (arg ndeps) as smaller as the distance between the
parameter and the bound, i.e.:
op<-optim(c(10,1), fn=LLNorm, method="L-BFGS-B", lower=c(-Inf, 0.0000001),
dat=rn2,hessian=FALSE)
H<-optimHess(op$par, LLNorm, dat=rn2,
control=list(ndeps=rep((op$par[2]-0)/1000,2)))
While this solution "...
2006 Jun 23
1
How to use mle or similar with integrate?
Hi
I have the following formula (I hope it is clear - if no, I can try to
do better the next time)
h(x, a, b) =
integral(0 to pi/2)
(
(
integral(D/sin(alpha) to Inf)
(
(
f(x, a, b)
)
dx
)
dalpha
)
and I want to do an mle with it.
I know how to use mle() and I also know about integrate(). My problem is
to give the parameter values a and b to the
2008 Aug 13
2
messing with ...
...t least that's the way it works
now -- one solution to the problem I'm about to state
is to insist that they specify the parameters in the
same order as they are given in the arguments of
the objective function).
However, there are other arguments (lower, upper,
control$parscale, control$ndeps) that should all
be in the same order as the objective function
definition by the time they get to optim()). I can
think of a few solutions:
(1) make the user specify them all in the right order (ugh)
(2) add all of them as explicit parameters to my function
so that I can rearrange them appr...
2011 May 25
1
L-BFGS-B and parscale in optim()
Hi,
When using method L-BFGS-B along with a parscale argument, should the
lower and upper bounds provided be on the scaled or unscaled values?
Thanks.
Cheers,
--
Seb
2008 Mar 07
1
parameters for lbfgsb (function for optimization)
..., 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 about.
How about fncount, rcount? R-ext.pdf or R help does not explain it in
detail. Any comments would help. Thank you.
[[alternative HTML version deleted]]
2010 Mar 01
2
Advice wanted on using optim with both continuous and discrete par arguments...
...the continuous variables and dumps back the initial values for the discrete variables. I presume that the numerical approximation to the gradients/hessian is thrown off by the `flat spots' or step-like-nature of the objective function with respect to the discrete variables.
I have played with ndeps, parscale etc. but nothing really works. I realize this is a mixed combinatorial optimization/continuous optimization problem and ideally would love pointers to any related literature or ideally an R package that implements such a beast.
However, if anyone has attempted to use optimization routin...
2005 Sep 06
2
fitting distributions with R
Dear all
I've got the dataset
data:2743;4678;21427;6194;10286;1505;12811;2161;6853;2625;14542;694;11491;
?? ?? ?? ?? ?? 14924;28640;17097;2136;5308;3477;91301;11488;3860;64114;14334
I know from other testing that it should be possible to fit the data with the
exponentialdistribution. I tried to get parameterestimates for the
exponentialdistribution with R, but as the values
of the parameter
2001 Sep 25
3
Error in optim(p, fun,...)
All:
I am getting an error code from the optimization function. The code is
Error in optim(p,fun.LLike, lower=low, upper = up, method = "L-BFGS-B", :
non-finite finite-difference value [0]
If I add a trace=6 option to my control list the last message before
this error is:
At X0, 0 variables are exactly at the bounds
Any ideas on where I should start would be
2001 Aug 09
0
converting BMDP 8V mixed model treatment to R ?
...advanced flexibility of a more modern treatment.) Here is the problem
statement in BMDP control language:
/input title='Augenbewegungen'.
variables=4.
file='latm.dat'.
format='11x,f7.0,f7.0,f12.4,f10.0'.
/variables names=
llat,rlat,vg,diff.
/design
ndep = 4.
level=21,2,2,9,3.
names = pers,retest,direct,flicker,ground.
random = pers.
fixed = retest,ground,direct,flicker.
model = 'P,R,G,D,F'.
/end.
/finish.
I tried in R (some minor differences in variable naming):
latm <- read.table( "latm.dat" )
latm.aov <- aov( llat ~ dir...
2001 Aug 09
1
converting a BMDP 8V mixed model to R / nlme
...ject to R (base or nlme), for which I have a
partial
solution in BMDP 8V. Here is the 8V control language:
/input title='Augenbewegungen'.
variables=4.
file='latm.dat'.
format='11x,f7.0,f7.0,f12.4,f10.0'.
/variables names=
llat,rlat,vg,diff.
/design
ndep = 4.
level=21,2,2,9,3.
names = person,retest,direct,flicker,ground.
random = person.
fixed = retest,ground,direct,flicker.
model = 'P,R,G,D,F'.
/end.
/finish.
BMDP 8V calculates the anova and reports F-values for tests of all fixed
effect
interactions against the error from the interaction...
2003 Feb 28
2
optim
Dear all,
I have a function MYFUN which depends on 3 positive parameters TETA[1],
TETA[2], and TETA[3]; x belongs to [0,1].
I integrate the function over [0,0.1], [0.1,0.2] and
[0.2,0.3] and want to choose the three parameters so that
these three integrals are as close to, resp., 2300, 4600 and 5800 as
possible. As I have three equations with three unknowns, I expect the
exact fit, i.e., the SS
2003 Nov 26
1
[PATCH] use 2.6 module syscalls in klibc
...nsigned long size_of_struct; /* == sizeof(module) */
- struct module *next;
- const char *name;
- unsigned long size;
-
- union
- {
- atomic_t usecount;
- long pad;
- } uc; /* Needs to keep its size - so says rth */
-
- unsigned long flags; /* AUTOCLEAN et al */
-
- unsigned nsyms;
- unsigned ndeps;
-
- struct module_symbol *syms;
- struct module_ref *deps;
- struct module_ref *refs;
- int (*init)(void);
- void (*cleanup)(void);
- const struct exception_table_entry *ex_table_start;
- const struct exception_table_entry *ex_table_end;
-#ifdef __alpha__
- unsigned long gp;
-#endif
- /* Members...
2002 Dec 23
1
klibc insmod for recent kernels
...nsigned long size_of_struct; /* == sizeof(module) */
- struct module *next;
- const char *name;
- unsigned long size;
-
- union
- {
- atomic_t usecount;
- long pad;
- } uc; /* Needs to keep its size - so says rth */
-
- unsigned long flags; /* AUTOCLEAN et al */
-
- unsigned nsyms;
- unsigned ndeps;
-
- struct module_symbol *syms;
- struct module_ref *deps;
- struct module_ref *refs;
- int (*init)(void);
- void (*cleanup)(void);
- const struct exception_table_entry *ex_table_start;
- const struct exception_table_entry *ex_table_end;
-#ifdef __alpha__
- unsigned long gp;
-#endif
- /* Members...
2004 Oct 04
7
R 2.0.0 is released
...;formula' method for pairs() has a 'na.action' argument,
defaulting to 'na.pass', rather than the value of
getOption("na.action").
o There are five new par() settings:
'family' can be used to specify a font family for graphics
text. This is a device-independent family specification
which gets mapped by the graphics device to a device-specific
font specification (see, for example, postscriptFonts()).
Currently, only PostScript, PDF, X11, Quartz, and Windows
respond to this setting.
'lend', 'ljoin', and 'lmitre' control t...
2004 Oct 04
7
R 2.0.0 is released
...;formula' method for pairs() has a 'na.action' argument,
defaulting to 'na.pass', rather than the value of
getOption("na.action").
o There are five new par() settings:
'family' can be used to specify a font family for graphics
text. This is a device-independent family specification
which gets mapped by the graphics device to a device-specific
font specification (see, for example, postscriptFonts()).
Currently, only PostScript, PDF, X11, Quartz, and Windows
respond to this setting.
'lend', 'ljoin', and 'lmitre' control t...