Displaying 20 results from an estimated 1200 matches similar to: "Optim function in the loop"
2009 Aug 20
1
Understanding R code
What is
1. par.ests <- optimfit$par
2. fisher <- hessb(negloglik, par.ests, maxvalue=maxima);
3. varcov <- solve(fisher);
4. par.ses <- sqrt(diag(varcov));
Thanks a lot,
fit.GEV <- function(maxima)
{
sigma0 <- sqrt((6. * var(maxima))/pi)
mu0 <- mean(maxima) - 0.57722 * sigma0
xi0 <- 0.1
theta <- c(xi0, mu0, sigma0)
#10/5/2007: removed assign() for maxima.nl
2010 Sep 29
2
R crashes when loading rgl package before minqa package
Hej,
Calling newuoa (from the minqa package) makes R crash when the package rgl
is loaded first. This however only on certain selected data.
The data used for testing (saved to 'bugs.R'):
xvals = c(1,2,4,5,7,8,9,10,11,12,14,15,16,18,19,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36)
yvals =
2008 Dec 31
2
function of mixture normal with covariates
Hello,
My name is Julia and I'm doing my phd on roc analysis.
I'm trying to write a maximization function for the likelihood attached in
the document.
For some reason it's not working I keep getting \this error:
Error: unexpected symbol in:
" +log(v_pred))
return"
> }
Error: unexpected '}' in "}"
>
>
2010 Jul 18
2
loop troubles
Hi all, I appreciate the help this list has given me before. I have a
question which has been perplexing me. I have been working on doing a
Bayesian calculating inserting studies sequentially after using a
non-informative prior to get a meta-analysis type result. I created a
function using three iterations of this, my code is below. I insert prior
mean and precision (I add precision manually
2011 Feb 03
1
"hubers" function in R MASS library : problem and solution
Hello:
I found the "hubers" function in MASS library is NOT working on the following
data:
> a <-
2010 Nov 30
1
StructTS with 2 seasons
Dear All,
I am trying to fit a structural time series model using the StructTS
function (package stats) with only 2 seasons (summer and winter). More
than 2 seasons work fine but with 2 seasons I get this error:
> fit <- StructTS(y.ts, type="BSM")
Error in T[cbind(ind + 1L, ind)] <- 1 : subscript out of bounds
I have looked at Prof. Ripley's 2002 RNews article but cannot
2007 Mar 09
1
MCMC logit
Hi,
I have a dataset with the binary outcome Y(0,1) and 4 covariates (X1,X@,X#,X$). I am trying to use MCMClogit to model logistic regression using MCMC. I am getting an error where it doesnt identify the covariates ,although its reading in correctly. The dataset is a sample of actual dataset. Below is my code:
> #######################
>
>
> #retreive data
> # considering four
2012 Oct 10
1
"optim" and "nlminb"
#optim package
estimate<-optim(init.par,Linn,hessian=TRUE, method=c("L-BFGS-B"),control =
list(trace=1,abstol=0.001),lower=c(0,0,0,0,-Inf,-Inf,-Inf,-Inf,-Inf,-Inf,-Inf,-Inf,-Inf),upper=c(1,1,1,1,Inf,Inf,Inf,Inf,Inf,Inf,Inf,Inf,Inf))
#nlminb package
estimate<-nlminb(init.par,Linn,gr=NULL,hessian=TRUE,control =
2003 Apr 03
1
Tukey's one degree of freedom for nonadditivity?
Is there code available to decompose interactions involving at least
one nominal factor with more than 2 levels as described, e.g., by Tukey
or by Mandel (1971, Technometrics, 13: 1-18)?
Tukey's model:
E(y[i,j]) = mu0 + a[i] + b[j] + c*a[i]*b[j],
estimating a, b, and c so sum(a) = sum(b)= 0. Mandel essentially
describes a singular value decomposition of the interaction.
Thanks,
2007 Dec 28
1
unit attribute to list elements
Hi,
I've started my own (first) package, part of which consists in
listing common physical constants (Planck's constant, the speed of
light in vacuum, etc). I'm wondering what would be a good way of
dealing with pairs of value/unit.
> constants <- list( cel = 2.99792458e8 , #m/s
> Z0 = 376.730313461, #ohm
> eps0 = 8.854187817e-12,#F/m
> mu0 = 4*pi*1e-7,#N/A^2
2001 Nov 09
2
ks.test
Dear R-List members,
I want to check if a set of measurements follows better a
gamma or a lognormal distribution (see data below).
Using shapiro.test I can test for normality (shapiro.test(log
(Lt)).
To test for gamma (and normal) distribution I would use
ks.test but I need to specify its shape and scale. How should
I calculate these values in R?
I tried
> Lt.fit <- glm(Lt ~ 1,
2008 Nov 11
1
simulate data with binary outcome and correlated predictors
Hi,
I would like to simulate data with a binary outcome and a set of predictors that are correlated. I want to be able to fix the number of event (Y=1) vs. non-event (Y=0). Thus, I fix this and then simulate the predictors. I have 2 questions:
1. When the predictors are continuous, I can use mvrnorm(). However, if I have continuous, ordinal and binary predictors, I'm not sure how to simulate
2009 Aug 21
3
extra .
sigma0 <- sqrt((6. * var(maxima))/pi)
What does the '.' do here?
--
View this message in context: http://www.nabble.com/extra-.-tp25073255p25073255.html
Sent from the R help mailing list archive at Nabble.com.
2007 Oct 14
1
Adjusting for heaping in data
Hi R users. I am new to the community and have got myself into a little problem.
I have a dataset of birth weights recorded by nurses at a delivery
clinic in an developing country.
The weights are entered in KiloGrams with one decimal. However there
is substantial heaping at each 500g when looking at the sample in a
histogram. Do anyone of you know a easy way to adjust for this and if
it exists
2008 Sep 09
2
test for a single variance
Dear R Gurus:
Is there a test for a single variance available in R, please?
Thanks,
Edna Bell
2010 Jun 23
1
A question about R2Winbugs
Dear R users:
I was trying to fit a HMM with mixture of Gaussian into the dataset, and I
tried to implement it by R2Winbugs. But I got the following errer.
*
Error in FUN(X[[1L]], ...) :
.C(..): 'type' must be "real" for this format*
Does anybody know what's the problem? Does R2Winbugs accept some matrix as
inits? I would really appreciate your help. Thank you very much.
2004 Dec 02
3
R and Fortran in Windows
I just joined the list and appologize if this has been answered before
but I am trying to interface between R and the Compaq Visual Fortran
compiler version 6.6 for Windows.
I found the following instructions on the web -- and an example. When I
follow these directions exactly. R 2.0.0 crashes. Has anyone had any
experience with this?
Below are the instructions that I located:
Thanks
Dan
2010 Sep 21
2
Trouble with Optimization in "Alabama" Package
Hello,
This is my first post to the help request list, so I'm going to err on the
side of giving too much information.
I'm working on writing a simulation in which agents will make repeated
production and exchange decisions with randomly chosen partners.
The idea is, all agents can produce two goods which they want to consume,
they choose a value t in [0,10] which sets their production
2005 Mar 04
2
Bluetooth phone as SIP handset?
Even better you can set your firefly softphone to auto answer so that
you don't even need to be near the pc to answer.
Cheers,
Dean
-----Original Message-----
From: asterisk-users-bounces@lists.digium.com
[mailto:asterisk-users-bounces@lists.digium.com] On Behalf Of Linn Boyd
Sent: Friday, March 04, 2005 2:12 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re:
2007 Oct 18
1
new FLAC support
as devices that support FLAC come out from time to time, I update the
front page on the FLAC site, but it occurred to me that people might
miss some of these. the ideal way would be to set up an rss news
feed but until that's ready, here are a few from the last month or so:
Linn Klimax DS networked digital music player
http://www.linn.co.uk/klimax_ds
Pioneer SC-LX90 amplifier