Displaying 20 results from an estimated 4000 matches similar to: "R: Help; error in optim"
2012 Apr 14
0
R-help: Censoring data (actually an optim issue
Your function is giving NaN's during the optimization.
The R-forge version of optimx() has functionality specifically intended to deal with this.
NOTE: the CRAN version does not, and the R-forge version still has some glitches!
However, I easily ran the code you supplied by changing optim to optimx in the penultimate
line. Here's the final output.
KKT condition testing
Number of
2012 Sep 20
3
Problem with Newton_Raphson
Hello,
I have being trying to estimate the parameters of the?generalized?exponential distribution. The random number generation for the GE distribution is?x<-(-log(1-U^(1/p1))/b), where U stands for uniform dist. The data i have generated to estimate the parameters is right censored and the code is given below; The problem is that, the newton-Raphson approach isnt working and i do not know what
2012 Apr 11
1
R-help; Censoring
Hello,
I wish to?censor 10% of my sample units of 50 from a Weibull distribution. Below is the code for it.
I will need to know whether what i have done is correct and if not, can i have any suggestion to improve it?
Thank you
?p=2;b=120
n=50
r=45
t<-rweibull(r,shape=p,scale=b)
meantrue<-gamma(1+(1/p))*b
meantrue
cen<- runif(n-r,min=0,max=meantrue)
cen
Chris Guure
Researcher,
2012 Feb 05
1
R- Fisher Information
Dear All,
Can you help me, with the code below how do I obtain the fisher information from it.
Is my q<-replicate(1000,x) the right way to do simulation.
thank you.
x<-rweibull(100,0.8,1.5)
q<-replicate(1000,x)
z<-function(p){
beta<-p[1]
eta<-p[2]
log1<-(n*log(beta)-n*beta*log(eta)+(beta-1)*sum(log(x))-sum((x/eta)^beta))
return(-log1)
}
zz<-optim(c(0.5,0.5),z)
zz
Chris
2012 Aug 28
1
Optim Problem
Hello,
I want to estimate the exponential parameter by using?optim?with the following input, where t contains 40% of the data and q contains 60% of the data within an interval. In implementing the code command for optim i want it to contain both the t and q data so i can obtain the correct estimate. Is there any suggestion as to how this can be done. I have tried h<-c(t,q) but it is not working
2012 Apr 11
1
R-help; generating censored data
Hello,
?can i implement this as 10% censored data where t gives me failure and x censored.
Thank you
p=2;b=120
n=50
set.seed(132);
r<-sample(1:50,45)
t<-rweibull(r,shape=p,scale=b)
t
set.seed(123);?
cens <- sample(1:50, 5)?
x<-runif(cens,shape=p,scale=b)?
x
Chris Guure
Researcher,
Institute for Mathematical Research
UPM
2012 Aug 31
3
fitting lognormal censored data
Hi ,
I am trying to get some estimator based on lognormal distribution when we have left,interval, and right censored data. Since, there is now avalible pakage in R can help me in this, I had to write my own code using Newton Raphson method which requires first and second derivative of log likelihood but my problem after runing the code is the estimators were too high. with this email ,I provide
2008 Jun 17
2
R error using Survr function with gcmrec
Would someone be able to help with this question? I'm using the
Gcmrec, Survrec, and Design packages to do a power analysis on
simulated data. I'm receiving an error after using the Survr function
that all data must have a censoring time even after using the gcmrec
function: newdata<-addCenTime(olddata). My program is below. I'd
greatly appreciate any help!
2009 Mar 05
1
File checking problem
Dear all,
I am a newcomer to R programming, I met the problem:
I have a lot of .txt files in my directory.
Firstly, I check whether the file satisfies the conditions:
1.empty
2.the "Rep" column of the file has no "useractivity_idle" or
"useractivity_act"
3.even The "rep" has both of them, numbers of "useractivity_idle"==numbers of
2009 Mar 06
1
About warnings for non-matched items
Dear All,
I have many files in my directory. I want to transfer each data into one which is readable.
They have so many possibilities, i have collected(manually and visually) all possibilities and represent them as different numbers.
Rep[grep('context_log',log1$Remain[1:length(log1$Date)]),]<-"2"
Rep[grep('gs',log1$Remain[1:length(log1$Date)]),]<-"5"
2009 Mar 05
1
Import the files.
Dear all,
I am a newcomer to R programming, I met the problem:
I have a lot of .txt files in my directory.
Firstly, I check whether the file satisfies the conditions:
1.empty
2.the "Rep" column of the file has no "useractivity_idle" or
"useractivity_act"
3.even The "rep" has both of them, numbers of "useractivity_idle"==numbers of
2012 Aug 04
2
find errors in a directory of files
hello list,
I'm trying to write a script that will search through a directory of trace
logs for an oracle database. From what I understand new files are always
being created in the directory and it's not possible to know the exact
names of the files before they are created. The purpose of this is to
create service checks in nagios. Because you don't know the names of the
files ahead
2013 Apr 15
2
regression with paired left-censored data
HI
I am trying to analyse data which is left-censored (i.e. has values below the detection limit). I have been using the NADA package of R to derive summary statistics and do some regression. I am now trying to carry out regression on paired data where both my X and Y have left-censored data within them.
I have tried various commands in R:
rega = cenreg(Cen(conc, cens_ind) ~ Gp_ident))?
with
2012 Mar 29
2
matrix with Loop
Hello!
I got something to ask..whether you can help me with the R program...i got this for example 5x4 matrix..and i want to find:
?i) mean for each row of the matrix
ii) median for each column of the matrix
and i need to do this using a loop function...below is my program..u try to check it for me as the output that i got is not what i desired...thanks..
data<-rnorm(20,0,1)
2008 Dec 09
2
Need help optimizing/vectorizing nested loops
Hi,
I'm analyzing a large number of large simulation datasets, and I've
isolated one of the bottlenecks. Any help in speeding it up would be
appreciated.
`dat` is a dataframe of samples from a regular grid. The first two
columns are the spatial coordinates of the samples, the remaining 20
columns are the abundances of species in each cell. I need to calculate
the species richness in
2004 Mar 21
1
Multilevel analysis with package lme
Dear list,
i am a student of psychology and have to do a multilevelanalysis on some data.
About that i have one general and one specific question.
This is what i have copied from the help-file on lme:
data(bdf)
fm <- lme(langPOST ~ IQ.ver.cen + avg.IQ.ver.cen, data = bdf,
random = ~ IQ.ver.cen | schoolNR)
summary(fm)
after summary(fm) i get the following error:
2007 Aug 16
1
Question about sm.options & sm.survival
Hi, there:
It's my first time to post question in this forum, so thanks for your
tolerance if my question is too naive. I am using a nonparametric smoothing
procedure in sm package to generate smoothed survival curves for continuous
covariate. I want to truncate the suvival curve and only display the part
with covariate value between 0 and 7. The following is the code I wrote:
2005 Oct 24
1
Error in step() (or stepAIC) for Cox model
Hello all,
I am trying to use stepwise procedure to select covariates in Cox model
and use bootstrap to repeat stepwise selection, then record how many
times variables are chosen by step() in bootstrap replications. When I
use step() (or stepAIC) to do model selection, I got errors. Here is the
part of my code
for (j in 1:mm){ #<--mm=10
for (b in 1:nrow(reg.bs)){ #<--bootstrap 10
2005 Jan 11
1
lme4 print and summary errror
Hi all - (this is posted to r-help and R-SIG-MAC)
OSX 10.3.7, R 2.0.1, lme4/Matrix/latticeExtra latest, fresh install of
R. MASS loaded (or not).
I am getting an error message for the print() and summary() commands
with all lme models I try and run in lme4 (GLMM's work fine). Using
the example from the lme help, summary and print produce the following
errors, despite the model being
2014 Jul 25
1
2.2.13 + hg: Panic: file ioloop.c: line 39 (io_add_file): assertion failed: (fd >= 0)
Hi,
Found this in logfiles:
Jul 25 14:12:38 dovecot: pop3(cen at so.red): Error: UIDL: File name lookup
failed: Message was expunged
Jul 25 14:12:38 dovecot: pop3(cen at so.red): Disconnected: POP3 UIDLs
couldn't be listed top=187/356348, retr=0/0, del=0/1207, size=789346199
Jul 25 14:12:38 dovecot: pop3(cen at so.red): Panic: file ioloop.c: line 39
(io_add_file): assertion failed: (fd