Displaying 8 results from an estimated 8 matches for "fitfunc".
2007 Nov 13
1
`eval' and environment question
...9;) in this code _not_ evaluate in
the local environment of function `f' but rather in the
global environment (if `f' is called from there)?
#----------------------------------------------------------
f <- function () {
a <- 1
x <- 1
model <- y ~ a * x
fitfunc <- deriv(model[[3]], c("a"), c("a", "x"))
call.fitfunc <- c(list(fitfunc), as.name("a"), as.name("x"))
call.fitfunc <- as.call(call.fitfunc)
curenv <- environment()
cat(" eval(call.fitfunc)\n")
r1 = eval(c...
2007 Nov 12
2
strange `nls' behaviour
...ing `deriv' to provide analytic
derivatives. the following fragment gives the idea:
#-----------------------------------------
f <- function(n = 4) {
x <- seq(0, 5, length = n)
y <- 2 * exp(-1*x) + 2;
y <- rnorm(y,y, 0.01*y)
model <- y ~ a * exp (-b*x) + c
fitfunc <- deriv(model[[3]], c("a", "b", "c"), c("a", "b", "c", "x"))
#"standard" call of nls:
res1 <- nls(y ~ fitfunc(a, b, c, x), start = c(a=1, b=1, c=1))
call.fitfunc <-
c(list(fitfunc), as.name(&quo...
2007 Nov 06
0
strange `nls' behaviour
...t complication when using `deriv' to provide
analytic derivatives. the following fragment gives the idea:
#-----------------------------------------
f <- function(n = 4) {
x <- 1:n
y <- 2 * exp(-1*x) + 2;
y <- rnorm(y,y, 0.01*y)
model <- y ~ a * exp (-b*x) + c
fitfunc <- deriv(model[[3]], c("a", "b", "c"), c("a", "b", "c", "x"))
res1 <- nls(y ~ fitfunc(a, b, c, x), start = c(a=1, b=1, c=1))
call.fitfunc <-
c(list(fitfunc), as.name("a"), as.name("b"), as....
2017 Jun 13
0
binequality - Problems with fitFunc()
binequality looks like just the package I need, specifically for obtaining Gini income coefficients for binned data.
I have upgraded to the latest version of R, the latest version of RStudio, and updated all packages. Still I have a persistent problem using fitFunc().
To keep things simple, I am testing things using the example code in the binequality manual, page 6 (or, "?fitFunc").
However, it exhibits the same problems as does my code and another example found elsewhere on the Internet, namely NA results for all fields of interest, as follows:...
2012 Sep 02
1
glmulti runs indefinitely when using genetic algorithm with lme4
...,0,10) # mock dependent variable
a = runif(30) # dummy covariate
b = runif(30) # another dummy covariate
c = runif(30) # an another one
x = as.factor(round(runif(30),1))# dummy grouping factor
# run exhaustive screening with lmer:
bab <- glmulti(y~a*b*c, level = 2, fitfunc = lmer.glmulti, random =
"+(1|x)")
This works fine. The problem is when I tell it to use the genetic
algorithm:
babs <- glmulti(y~a*b*c, level = 2, fitfunc = lmer.glmulti, random =
"+(1|x)", method = "g")
It just keeps running indefinitely and the AIC...
2013 Apr 15
1
Optimisation and NaN Errors using clm() and clmm()
...erating a confidence set of 200
models using clm() and the 'glmulti' R package. This produces these errors:
/> model.2.10 <- glmulti(as.factor(dependent) ~
predictor_1*predictor_2*predictor_3*predictor_4*predictor_5*predictor_6*predictor_7*predictor_8*predictor_9,
data = database, fitfunc = clm, link = "probit", method = "g", crit =
aicc, confsetsize = 200, marginality = TRUE)
...
After 670 generations:
Best model:
as.factor(dependent)~1+predictor_1+predictor_2+predictor_3+predictor_4+predictor_5+predictor_6+predictor_8+predictor_9+predictor_4:predictor_3+predi...
2018 Jan 31
0
MICE data analysis with glmulti
...e the variable "Ozone" into all models with the following code:
glm.redefined = function(formula, data, always="", ...)?
{glm(as.formula(paste(deparse(formula), always)), data=data, ...)}
then run glmulti:
output<-glmulti(with(tempData,Temp~Solar.R+Wind),?
? ? ? ? ? ? ? ? fitfunc=glm.redefined,?
? ? ? ? ? ? ? ? level=1,?
? ? ? ? ? ? ? ? crit=aic,?
? ? ? ? ? ? ? ? method="h",?
? ? ? ? ? ? ? ? always= "+Ozone")
which will obviously fail once you give it a try... any thoughts on how to identify the best model using glmulti in this fashion? that would fit...
2012 Nov 08
1
Package "glmulti": Include a variable in ALL models
...ulti).
To include the variable "Geslacht" in all models:
> glm.redefined = function(formula, data, always="", ...) {glm(as.formula(paste(deparse(formula), always)), data=data, ...)}
> output<-glmulti(ZBK3~ Onafhankelijk*Zelfconcept*Hyperactief*Populariteit, data=IME, fitfunc=glm.redefined, level=2, crit=aic, method="g", always= "+Geslacht")
However, in the output, the variable "Geslacht" is not included... :
> print(output)
glmulti.analysis
Method: g / Fitting: glm.redefined / IC used: aic
Level: 2 / Marginality: FALSE
>From 100 mod...