search for: mu2s

Displaying 20 results from an estimated 75 matches for "mu2s".

Did you mean: mu2
2012 Oct 05
2
problem with convergence in mle2/optim function
Hello R Help, I am trying solve an MLE convergence problem: I would like to estimate four parameters, p1, p2, mu1, mu2, which relate to the probabilities, P1, P2, P3, of a multinomial (trinomial) distribution. I am using the mle2() function and feeding it a time series dataset composed of four columns: time point, number of successes in category 1, number of successes in category 2, and
2012 Sep 27
0
problems with mle2 convergence and with writing gradient function
Dear R help, I am trying solve an MLE convergence problem: I would like to estimate four parameters, p1, p2, mu1, mu2, which relate to the probabilities, P1, P2, P3, of a multinomial (trinomial) distribution. I am using the mle2() function and feeding it a time series dataset composed of four columns: time point, number of successes in category 1, number of successes in category 2, and
2012 Oct 11
2
model selection with spg and AIC (or, convert list to fitted model object)
Dear R Help, I have two nested negative log-likelihood functions that I am optimizing with the spg function [BB package]. I would like to perform model selection on these two objective functions using AIC (and possibly anova() too). However, the spg() function returns a list and I need a fitted model object for AIC(), ICtab() [bbmle package], or anova(). How can I perform AIC-based model
2011 Jan 27
1
Errors in Integrate
Hello, I have written the function I would like to integrate in two ways: denfxn <- function(yy,vv,a2,b2,mu2) { pp <- 1-pnorm(yy/sqrt(vv)) part1 <- pp^(a2-1) part2 <- (1-pp)^(b2-1) part3 <- dnorm(yy,mu2,sqrt(vv)) return(part1*part2*part3) } denfxnorg <- function(yy,vv,a2,b2,mu2) { pp <- 1-pnorm(yy/sqrt(vv)) pp <- if (pp < .001) .001 else
2007 Oct 23
1
How to avoid the NaN errors in dnbinom?
Hi, The code below is giving me this error message: Error in while (err > eps) { : missing value where TRUE/FALSE needed In addition: Warning messages: 1: In dnbinom(x, size, prob, log) : NaNs produced 2: In dnbinom(x, size, prob, log) : NaNs produced I know from the help files that for dnbinom "Invalid size or prob will result in return value NaN, with a warning", but I am not able
2006 May 21
2
nls & fitting
Dear All, I may look ridiculous, but I am puzzled at the behavior of the nls with a fitting I am currently dealing with. My data are: x N 1 346.4102 145.428256 2 447.2136 169.530634 3 570.0877 144.081627 4 721.1103 106.363316 5 894.4272 130.390552 6 1264.9111 36.727069 7 1788.8544 52.848587 8 2449.4897 25.128742 9 3464.1016 7.531766 10 4472.1360 8.827367 11
2009 Jul 17
6
Solving two nonlinear equations with two knowns
Dear R users, I have two nonlinear equations, f1(x1,x2)=0 and f2(x1,x2)=0. I try to use optim command by minimize f1^2+f2^2 to find x1 and x2. I found the optimal solution changes when I change initial values. How to solve this? BTW, I also try to use grid searching. But I have no information on ranges of x1 and x2, respectively. Any suggestion to solve this question? Thanks, Kate
2005 Nov 09
2
About: Error in FUN(X[[1]], ...) : symbol print-name too long
Hi, I??m trying to use the Win2BUGS package from R and I have a similar problem that reurns with the message: Error in FUN(X[[1]], ...) : symbol print-name too long But, there is no stray ` character in the file ( Sugestions given by: Duncan Temple Lang <duncan> Date: Mon, 26 Sep 2005 07:31:08 -0700 ) The progam in R is: library(R2WinBUGS) library(rbugs) dat <-
2013 Feb 01
2
How does this function print, why is n1 which equals 1 printed as 2?
Windows 7, R 2.12.1 Colleagues, I am trying to understand the n.for.2means function. The code below is a copy of the function (renamed to n.for.2means.js). I have inserted a single line of code towards the bottom of the function which uses the cat function to print the value of n1. You will note the value (preceded by stars) is printed as 1. The function (1) prints a lot of output without any
2007 Mar 06
2
Estimating parameters of 2 phase Coxian using optim
Hi, My name is Laura. I'm a PhD student at Queen's University Belfast and have just started learning R. I was wondering if somebody could help me to see where I am going wrong in my code for estimating the parameters [mu1, mu2, lambda1] of a 2-phase Coxian Distribution. cox2.lik<-function(theta, y){ mu1<-theta[1] mu2<-theta[2] lambda1<-theta[3]
2006 Jun 07
2
help with combination problem
hello: I have 3 data.frame objects. First df object: Of dim (149,31). Columns 2:31 are marked as T1..T14 and N1..N16. Name T1 T2 N1 T3 N2 N3 N4 T4 mu1 10 10 9 10 9 9 8 10 mu2 11 11 9 11 9 9 9 11 ... muN 12 12 9 11 9 9 8 12 Second df object: of Dim (50000,31). Columns 2:31 are maked as T1...T14 and N1..N16.
2009 Mar 30
0
Problem in S4 object displaying from within a Java application using JRI
I am using JRI (Java R Interface) library in order to call R from within my Java application. But since the "rmu1" and "rmu2" ,see the following code, are objects of type S4 once i run the application the value of Null will be returned for both of them. On this regard, i would appreciate it if anyone can tell me how i am going to display and/ or convert these objects to Java
2013 Apr 09
0
[R-SIG-Finance] EM algorithm with R manually implemented?
Moved to R-help because there's no obvious financial content. Michael On Sat, Apr 6, 2013 at 10:56 AM, Stat Tistician <statisticiangermany at gmail.com> wrote: > Hi, > I want to implement the EM algorithm manually, with my own loops and so. > Afterwards, I want to compare it to the normalmixEM output of mixtools > package. > > Since the notation is very advanced, I
2008 Feb 15
1
Questions about EM algorithm
Dear all: Assume I have 3 distributions, x1, x2, and x3. x1 ~ normal(mu1, sd1) x2 ~ normal(mu2, sd2) x3 ~ normal(mu3, sd3) y1 = x1 + x2 y2 = x1 + x3 Now that the data I can observed is only y1 and y2. It is easy to estimate (mu1+m2), (mu1+mu3), (sd1^2+sd2^2) and (sd1^2+sd3^2) by EM algorithm since y1 ~ normal(mu1+mu2, sqrt(sd1^2+sd2^2)) and y2 ~ normal(mu1+mu3, sqrt(sd1^2+sd3^2)) However, I want
2010 Jun 13
1
using latticeExtra plotting confidence intervals
I am wanting to plot a 95% confidence band using segplot, yet I am wanting to have groups. For example if I have males and females, and then I have them in different races, I want the racial groups in different panels. I have this minor code, completely made up but gets at what I am wanting, 4 random samples and 4 samples of confidence, I know how to get A & B into one panel and C&D in to
2009 Oct 31
1
Help me improving my code
Hi, I am new to R. My problem is with the ordered logistic model. Here is my question: Generate an order discrete variable using the variable wrwage1 = wages in first full calendar quarter after benefit application in the following way: * wage*1*Ordered *= 1 *if*0 *· wrwage*1 *< *1000 2 *if*1000 *· wrwage*1 *< *2000 3 *if*2000 *· wrwage*1 *< *3000 4 *if*3000 *· wrwage*1 *<
2010 Mar 20
2
EM algorithm in R
Please help me in writing the R code for this problem. I've been solving this for 4 days. It was hard for me to solve it. It's a simulation problem in R. The problem is My true model is a normal mixture which is given as 0.5 N(-0.8,1) + 0.5 N(0.8,1). This model has two components. I will get a random sample of size 100 from this model. I will do this 300 times. That means, I will have
2009 May 22
0
EM algorithm mixture of multivariate
Hi, i would to know, if someone have ever write the code to estimate the parameter (mixing proportion, mean, a var/cov matrix) of a mixture of two multivariate normal distribution. I wrote it and it works (it could find mean and mixing proportion, if I fix the var/cov matrix), while if I fix anything, it doesn't work. My suspect is that when the algorithm iterates the var/cov matrix, something
2008 Apr 05
2
How to improve the "OPTIM" results
Dear R users, I used to "OPTIM" to minimize the obj. function below. Even though I used the true parameter values as initial values, the results are not very good. How could I improve my results? Any suggestion will be greatly appreciated. Regards, Kathryn Lord #------------------------------------------------------------------------------------------ x = c(0.35938587,
2008 Apr 05
2
How to improve the "OPTIM" results
Dear R users, I used to "OPTIM" to minimize the obj. function below. Even though I used the true parameter values as initial values, the results are not very good. How could I improve my results? Any suggestion will be greatly appreciated. Regards, Kathryn Lord #------------------------------------------------------------------------------------------ x = c(0.35938587,