Displaying 20 results from an estimated 200 matches similar to: "How to scan df from a specific word?"
2010 Oct 31
1
R-help Digest, Vol 92, Issue 31
Hi, I'd like to unsubscribe from the list.
Thanks
Neyra
________________________________
De: "r-help-request@r-project.org" <r-help-request@r-project.org>
Para: r-help@r-project.org
Enviado: sáb, octubre 30, 2010 5:30:07 AM
Asunto: R-help Digest, Vol 92, Issue 31
Send R-help mailing list submissions to
r-help@r-project.org
To subscribe or unsubscribe via the
2006 Oct 27
1
(no subject)
Hi,
I have generated a profile likelihood for a parameter (x) and am
trying to get 95% confidence limits by calculating the two points
where the log likelihood (LogL) is 2 units less than the maximum
LogL. I would like to do this by linear interpolation and so I have
been trying to use the function approxfun which allows me to get a
function to calculate LogL for any value of x within
2008 Mar 04
6
vector manipulations
Un texte encapsul? et encod? dans un jeu de caract?res inconnu a ?t? nettoy?...
Nom : non disponible
Url : https://stat.ethz.ch/pipermail/r-help/attachments/20080304/9de37092/attachment.pl
2005 Jun 29
2
MLE with optim
Hello,
I tried to fit a lognormal distribution by using optim. But sadly the output
seems to be incorrect.
Who can tell me where the "bug" is?
test = rlnorm(100,5,3)
logL = function(parm, x,...) -sum(log(dlnorm(x,parm,...)))
start = list(meanlog=5, sdlog=3)
optim(start,logL,x=test)$par
Carsten.
[[alternative HTML version deleted]]
2010 Jul 07
3
Boxplots over a Scatterplot
Hello-
I'm new to R, coding and stats. (Oh no.)
Anyway, I have about 12000 data points in a data.frame (dealing with
dimensions and geological stage information for fossil protists) and have
plotted them in a basic scatter plot. I also added a boxplot to overlay
these points. Each worked fine independently, but when I attempt to
superimpose them with add=true, I get a different scale for
2005 May 31
1
Solved: linear regression example using MLE using optim()
Thanks to Gabor for setting me right. My code is as follows. I found
it useful for learning optim(), and you might find it similarly
useful. I will be most grateful if you can guide me on how to do this
better. Should one be using optim() or stats4::mle?
set.seed(101) # For replicability
# Setup problem
X <- cbind(1, runif(100))
theta.true <- c(2,3,1)
y <- X
2009 Jul 01
2
Difficulty in calculating MLE through NLM
Hi R-friends,
Attached is the SAS XPORT file that I have imported into R using following code
library(foreign)
mydata<-read.xport("C:\\ctf.xpt")
print(mydata)
I am trying to maximize logL in order to find Maximum Likelihood Estimate (MLE) of 5 parameters (alpha1, beta1, alpha2, beta2, p) using NLM function in R as follows.
# Defining Log likelihood - In the function it is noted as
2007 Jun 19
1
Error handling
Hello,
I have a question about error handling. I run simulation studies and often the program stops with an error, for example during maximum likelihood. I would like the program not to stop but to continue and I would like to ask how the error handling can be set up for this (if it can). I tried to look through manuals etc but unfortunately did not get closer to the solution. Below is a
2010 Jul 08
2
Using nlm or optim
Hello,
I am trying to use nlm to estimate the parameters that minimize the
following function:
Predict<-function(M,c,z){
+ v = c*M^z
+ return(v)
+ }
M is a variable and c and z are parameters to be estimated.
I then write the negative loglikelihood function assuming normal errors:
nll<-function(M,V,c,z,s){
n<-length(Mean)
logl<- -.5*n*log(2*pi) -.5*n*log(s) -
2008 Aug 12
2
Maximum likelihood estimation
Hello,
I am struggling for some time now to estimate AR(1) process for commodity price time series. I did it in STATA but cannot get a result in R.
The equation I want to estimate is: p(t)=a+b*p(t-1)+error
Using STATA I get 0.92 for a, and 0.73 for b.
Code that I use in R is:
p<-matrix(data$p) # price at time t
lp<-cbind(1,data$lp) # price at time t-1
2008 Sep 19
2
Error: function cannot be evaluated at initial parameters
I have an error for a simple optimization problem. Is there anyone knowing
about this error?
lambda1=-9
lambda2=-6
L<-function(a){
s2i2f<-(exp(-lambda1*(250^a)-lambda2*(275^a-250^a))
-exp(-lambda1*(250^a)-lambda2*(300^a-250^a)))
logl<-log(s2i2f)
return(-logl)}
optim(1,L)
Error in optim(1, L) : function cannot be evaluated at initial parameters
Thank you in advance
--
View this
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 "}"
>
>
2011 Dec 01
1
Estimation of AR(1) Model with Markov Switching
Dear R users,
I have been trying to obtain the MLE of the following model
state 0: y_t = 2 + 0.5 * y_{t-1} + e_t
state 1: y_t = 0.5 + 0.9 * y_{t-1} + e_t
where e_t ~ iidN(0,1)
transition probability between states is 0.2
I've generated some fake data and tried to estimate the parameters using the
constrOptim() function but I can't get sensible answers using it. I've tried
using
2007 Jan 06
2
negative binomial family glm R and STATA
Dear Lister,
I am facing a strange problem fitting a GLM of the negative binomial
family. Actually, I tried to estimate theta (the scale parameter)
through glm.nb from MASS and could get convergence only relaxing the
convergence tolerance to 1e-3. With warning messages:
glm1<-glm.nb(nbcas~.,data=zonesdb4,control=glm.control(epsilon = 1e-3))
There were 25 warnings (use warnings() to see
2011 Feb 10
2
Comparison of glm.nb and negbin from the package aod
I have fitted the faults.data to glm.nb and to the function negbin from the
package aod. The output of both is the following:
summary(glm.nb(n~ll, data=faults))
Call:
glm.nb(formula = n ~ ll, data = faults, init.theta = 8.667407437,
link = log)
Deviance Residuals:
Min 1Q Median 3Q Max
-2.0470 -0.7815 -0.1723 0.4275 2.0896
Coefficients:
2011 Jun 21
2
par code help
I am making a barplot using barplot2 from gplots where each bar
represents a specific tree species. I have formatted the species names
on the x-axis so that the genus name is above the species name and
have then rotated the labels 45 degrees to save room. This is my code:
>columncolor<-c("grey20", "grey20", "grey20", "grey70",
2005 May 30
1
Trying to write a linear regression using MLE and optim()
I wrote this:
# Setup problem
x <- runif(100)
y <- 2 + 3*x + rnorm(100)
X <- cbind(1, x)
# True OLS --
lm(y ~ x)
# OLS likelihood function --
ols.lf <- function(theta, K, y, X) {
beta <- theta[1:K]
sigma <- exp(theta[K+1])
e <- (y - X%*%beta)/sigma
logl <- sum(log(dnorm(e)))
return(logl)
}
optim(c(2,3,0), ols.lf, gr=NULL,
method="BFGS",
2010 Mar 26
1
Problems if optimization
What's up fellows...
I am a begginer in R and i am trying to find the parameters of one
likelihood function, but when i otimize it, always appers a error or
advertisement and the solve does not occur.
The problem seems like that:
"lMix<-function(pars,y){
beta1<-pars[1]
beta2<-pars[2]
beta3<-pars[3]
beta4<-pars[4]
beta5<-pars[5]
alfa1<-pars[6]
2016 Apr 04
2
RFC: Constant folding math functions for long double
Hi Joerg,
> IMO if constant folding of transcendental functions makes a significant
difference for your program, you likely are doing something strange
already.
Alas it's not as simple as that. Currently, if you declare:
std::uniform_real_distribution<float> x;
LLVM emits two calls to logl() with constant arguments, a fdiv and a fptoui.
Libc++'s implementation is consumed and
2016 Apr 04
9
RFC: Constant folding math functions for long double
Hi,
Clang is currently unable to constant fold calls to math.h functions such
as logl(), expl() etc.
The problem is that APFloat doesn't have these functions, so Clang is
forced to rely on the host math library. Because long double isn't
portable, we only ever query the host math library for double or float
results.
I can see three methods for allowing constant folding for types that