similar to: maximum likelihood

Displaying 20 results from an estimated 500 matches similar to: "maximum likelihood"

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
2009 Mar 02
1
(no subject)
Greetings, I am using fGarch package to estimate and simulate GARCH models. What I would like to do is to perform Monte Carlo simulation. Unfortunately I cannot figure how to modify the code to achieve this. I use the following code to run a single simulation: spec=garchSpec(model=list(ar= 0.440270860, omega=0.000374365,alpha=0.475446583 , mu=0, beta=0)) sim<-garchSim(spec,
2009 Mar 12
0
GARCH variance equation with dummy variables
I am estimating daily electricity prices using GARCH (1,1). What I would like to see is whether there is some kind of daily or seasonal effect in variance of the price series. For instance, variance of electricity prices might be different (higher) during weekdays as opposed to during weekend. Thus, I would like to include some dummy variables in variance equation -but I don't know how to
2009 Mar 24
0
Unit root
I am confused by obtaining different results when testing for unit root when using different packages. I have 2625 price entries for which I want to determine whether they exhibit unit root. First I test using adf.test from tseries package by running: > adf.test(P, k=30) Augmented Dickey-Fuller Test data: P Dickey-Fuller = -4.685, Lag order = 30, p-value = 0.01 alternative hypothesis:
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]
2005 Aug 12
0
HowTo derive a correct likelihood-ratio chi-squared statistic from lrm() with a rsc() ?
Dear R helpers, >From the lrm( ) model used for binary logistic regression, we used the L.R. model value (or the G2 value, likelihood-ratio chi-squared statistic) to evaluate the goodness-of-fit of the models. The model with the lowest G2 value consequently, has the best performance and the highest accuracy. However our model includes rsc() functions to account for non-linearity. We
2011 Mar 28
1
maximum likelihood accuracy - comparison with Stata
Hi everyone, I am looking to do some manual maximum likelihood estimation in R. I have done a lot of work in Stata and so I have been using output comparisons to get a handle on what is happening. I estimated a simple linear model in R with lm() and also my own maximum likelihood program. I then compared the output with Stata. Two things jumped out at me. Firstly, in Stata my coefficient
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 Sep 16
0
Maximum likelihood estimation of a truncated regression model
Hi, I have a quick question regarding estimation of a truncation regression model (truncated above at 1) using MLE in R. I will be most grateful to you if you can help me out. The model is linear and the relationship is "dhat = bhat0+Z*bhat+e", where dhat is the dependent variable >0 and upper truncated at 1; bhat0 is the intercept; Z is the independent variable and is a uniform
2018 May 19
0
Lower bound and upper bound in maximum likelihood
Dear all, I need to simulate data which fit to a double poisson time series model with certain parameters. Then, check whether the estimated parameter close to the true parameter by using maximum likelihood estimation. Simulation: set.seed(10) library("rmutil") a0 = 1.5; a1 = 0.4; b1 = 0.3; g1= 0.7 ; n=100 #a0, a1 and b1 are parameter where n is size. nu = h =
2008 Dec 04
0
integration within maximum likelihood
Hi: I'm trying to estimate a latent variable model in mnl discrete choice framework using R. I need to do first a uni dimensional integral within each observation (row) in the database and then sum over observations. I'm stacked in the point shown below. Apparently I have a dimensionality problem in the definition of the integral. Maybe it does not identify that what I need is only one
2010 Jul 20
0
Maximum likelihood estimation in R
Dear R-helper, I am trying to do maximum likelihood estimation in R. I use the "optim" function. Since I have no prior information on the true values of the parameters, I just randomly select different sets of starting values to feed into the program. Each time, I get the following error message: Error in optim(theta0, lf, method = "BFGS", hessian = T, Y = Y, X = X, :
2009 Sep 24
1
Maximum likelihood estimation of parameters make no biological sense
R-help, I'm trying to estimate some parameters using the Maximum Likehood method. The model describes fish growth using a sigmoidal-type of curve: fn_w <- function(params) { Winf <- params[1] k <- params[2] t0 <- params[3] b <- params[4] sigma <- params[5] what <- Winf * (1-exp(- k *(tt - t0)))^b
2008 Sep 11
0
Loop for the convergence of shape parameter
Hello, The likelihood includes two parameters to be estimated: lambda (=beta0+beta1*x) and alpha. The algorithm for the estimation is as following: 1) with alpha=0, estimate lambda (estimate beta0 and beta1 via GLM) 2) with lambda, estimate alpha via ML estimation 3) with updataed alpha, replicate 1) and 2) until alpha is converged to a value I coded 1) and 2) (it works), but faced some
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
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
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 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
2006 Mar 13
1
Formatting an anova table using latex
Hi r-helpers, When I issue the command latex(anova(raw1.lmer0, raw1.lmer, raw1.lmerI), file = 'raw1.tex', rownamesTexCmd = c('baR', 'addit', 'multip'), longtable = F, dcolumn = T, booktabs = T, t able.env = F, colheads = NULL, colnamesTexCmd = c ('', 'df', 'aic', 'bic', 'logl', 'chisq', 'chisqdf',
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]]