Questions tagged [nlm]

29 questions
10
votes
1 answer

Error in optim: function cannot be evaluated at initial parameters

So I've run into this weird error in R. I have a simple function which returns an error term when comparing real and simulated prices, called hestondifferences(). when I try to find the local minima via: res<-optim(fn=hestondifferences, par =…
jcfrei
  • 1,819
  • 4
  • 19
  • 35
4
votes
3 answers

R: mix() in mixdist package returning error

I have installed the mixdist package in R to combine distributions. Specifically, I'm using the mix() function. See documentation. Basically, I'm getting Error in nlm(mixlike, lmixdat = mixdat, lmixpar = fitpar, ldist = dist, : missing…
swetharevanur
  • 99
  • 1
  • 11
3
votes
1 answer

nlm with multiple variables in R

I am trying to use nlm() to minimize the SSE in a function. I'm having trouble with they syntax and getting nlm() to provide estimates for both variables. Eventually t_1, t_2, and t_3 will be values pulled from a data.frame but I just assigned them…
vb66
  • 353
  • 3
  • 14
3
votes
0 answers

clustered (grouped) standard errors Maximum Likelihood R

I'm doing the following maximum likelihood estimation using mle2 function from bbmle package: llik.probit2<- function(aL,beta, Ks, Kw, Bs, Bw, dta){ Y <- as.matrix(dta$qualified) sce1 <- as.matrix(dta$eds) wce1 <- as.matrix(dta$edw) sce1_obs…
Nidjsi
  • 73
  • 1
  • 5
3
votes
1 answer

Source code of nlm function in stats package

I need to find the source code of the nlm function. When I use edit(nlm) below code appears function (f, p, ..., hessian = FALSE, typsize = rep(1, length(p)), fscale = 1, print.level = 0, ndigit = 12, gradtol = 1e-06, stepmax = max(1000…
Artiga
  • 776
  • 2
  • 16
  • 37
2
votes
1 answer

R optim/nlm with multidimensional array of parameters

I'm using optim/nlm to do a maximum likelihood estimation, and my parameters are in a multidimensional array. The likelihood evaluates fine, i.e. given a data x, and multidimensional array of parameters theta, likelihood(theta,x) gives a real…
pmangg
  • 35
  • 1
  • 3
2
votes
1 answer

Non-Linear Minimization (nlm) in R with error: incorrect number of dimensions

I have this code where it calculates the negative binomial distribution, with parameters: ce <- c(0, 1, 2, 3, 4, 5) ce <- as.integer(ce) comp <- c(257, 155, 64, 17, 5, 2) comp <- as.integer(comp) data.cells <- data.frame(ce, comp) params <- c(5,…
Jespar
  • 1,017
  • 5
  • 16
  • 29
2
votes
1 answer

Register for NLM events (INetworkListManager, Advise, Sink, etc.)

In my Delphi application I'd like to get informed about network changes using the Microsoft Windows Network List Manager API (NLM): http://msdn.microsoft.com/library/ee264321 I've looked at the linked "How to register for NLM events" example and…
CodeX
  • 717
  • 7
  • 23
2
votes
3 answers

Unit testing a module that checks internet connectivity

I have a C# module responsible for acquiring the list of network adapters that are "connected to the internet" on a windows Vista machine. The module uses the "Network List Manager API" (or NLM API) to iterate over all network connections and…
Hershi
  • 2,080
  • 2
  • 19
  • 24
2
votes
1 answer

XML import of IndexCat files

the National Library of Medicine (NLM) has made available to the public last April its Index Medicus collection. This collection is composed of 5 series, each series containing several volumes. These files are available as XML files at this…
1
vote
1 answer

selection of nlm starting values problem

Need to estimate two parameters using the nlm function; fit<-nlm(hood2par,c(x01[i],x02[j]),iterlim=300, catch=x[,c(3,4,5)],sp=.5) where hood2par is a modified logistic The convergence of nlm depends on the starting values ​​of these parameters. To…
jrs-x
  • 336
  • 1
  • 2
  • 10
1
vote
1 answer

Finding Implied Volatility of Option using nlm function in R

I have an assignment that requires me to calculate the implied volatility of a series of options using their parameters and market price. I understand that the easy way to do this would be to use the compute.implied.volatility function within R,…
cbayntun
  • 11
  • 3
1
vote
2 answers

Nesting nlm function inside ddply/dlply

I need to interpolate by groups a large dataframe using the nlm function. I don't have any problems using it on a df with a single group: #example data df <- data.frame(var= cumsum(sort(rnorm(100, mean=20, sd=4))), time=…
Matt_4
  • 147
  • 1
  • 12
1
vote
0 answers

VIFGC_ovedom function in GenABEL

I am using non-additive GWAS models implemented in GenABEL. VIFGC function for dominant and recessive GWAS non-additive model is working fine but for overdominance inheritance with the same data, VIFGC_ovedom function is giving an error: Error:…
1
vote
1 answer

MLE in R bivariate normal

I'm experiencing a problem, possibly due to my coding mistake. I want to perform an MLE for a bivariate normal sample by an algorithm: require(MASS) require(tmvtnorm) require(BB) require(matrixcalc) mu = c(0,0) covmat =…
null
  • 1,944
  • 1
  • 14
  • 24
1
2