This is the part of the function in my likelihood function
prob<-function(t1,t2,m1,m2,s_r,s_p,s_e,cor_m){
if ((t1==0) & (t2==0))
log_lik<-log(pmvnorm(lower=rep(-Inf, 2),
upper=c(m1/sqrt(s_r+s_p+s_e+1),m2/sqrt(s_r+s_p+s_e+1)),
mean=rep(0,2), corr=cor_m))
else if ((t1==0) & (t2==1))
log_lik<
What distribution's log-likelihood are you using? If sigma is supposed
to be square-rooted, you may have to put a constraint or use of abs()
might suffice -- though, admittedly I'm not sure what that will do to
convergence behavior -- but it's hard to help without seeing the
function at hand.
Mich
Dear R Users
I am maximizing a user defined log likelihood function. It includes variance
parameter (sigma). I used R function optim with BFGS maximization method.
However, it stops before the solution saying “sqrt(sigma): NaNs produced”
Could anybody know a proper transformation for sigma which
On Tue, Oct 25, 2011 at 12:04 PM, Eliano wrote:
> hi people,
>
> I'm trying to maximize this function:
>
> fn= function (x) {x[1]^2+5*x[2]^2}
>
> with this restriction
> fn1 = function (x) {x[1]+x[2] <=5}
>
> Can someone help me how to procedure this?
>
> I tried in the alabama and genoud package
Eliano Marques writes:
> Hi there,
>
> I need help in an optimization procedement.
>
> I'm trying to maximize the function fn=x^2+5y^2 with the restriction of
> fn1=x-y<=5.
>
> I tried the genoud method and as well the alabama method.
>
> I have problems to set the constraint in R.
>
> Can someon
Hi there,
I need help in an optimization procedement.
I'm trying to maximize the function fn=x^2+5y^2 with the restriction of
fn1=x-y<=5.
I tried the genoud method and as well the alabama method.
I have problems to set the constraint in R.
Can someone help me please?
Regards,
Eliano
hi people,
I'm trying to maximize this function:
fn= function (x) {x[1]^2+5*x[2]^2}
with this restriction
fn1 = function (x) {x[1]+x[2] <=5}
Can someone help me how to procedure this?
I tried in the alabama and genoud package but i have problems with the
setting of constrains.
Regards,
Eliano
-help-boun...@r-project.org] On Behalf Of
Klaus Langohr [klaus.lang...@upc.edu]
Sent: Thursday, May 12, 2011 3:29 PM
To: r-help@r-project.org
Subject: [R] Maximization of a loglikelihood function with double sums
Dear R experts,
Attached you can find the expression of a loglikelihood function which I
Tuesday, May 18, 2010 2:38 pm
Subject: [R] Maximization of quadratic forms
To: r-help@r-project.org
> Dear R Help,
>
> I am trying to fit a nonlinear model for a mean function
> $\mu(Data_i,\beta)$ for a fixed covariance matrix where $\beta$ and
> $\mu$ are low-dimensional
Dear R Help,
I am trying to fit a nonlinear model for a mean function $\mu(Data_i,
\beta)$ for a fixed covariance matrix where $\beta$ and $\mu$ are low-
dimensional. More specifically, for fixed variance-covariance matrices
$\Sigma_{z=0}$ and $\Sigma_{z=1}$ (according to a binary covariate $
There is a package "lpSolve" that you might want to look at. At the R
prompt, do the following:
> install.packages("lpSolve")
Once the package will be installed, you can type help(lpSolve) to get
details.
cheers,
-Girish
On Nov 13, 8:37 am, "Yun, Myung Ho" <[EMAIL PROTECTED]>
wrote:
> Dear All,
This is 'linear programming'. Try
RSiteSearch("linear programming")
The first few fits will give you a lot to explore.
On Thu, 13 Nov 2008, Yun, Myung Ho wrote:
Dear All,
First of all, this is the first time for me to use R for optimization, I
tried to search r-help postings & googled on wei
Dear All,
First of all, this is the first time for me to use R for optimization, I
tried to search r-help postings & googled on weighted sum optimization,
I could not find anything applicable.
I would need to optimize following function in R;
MAXIMIZE
function = w1*R1 + w2*R2 + w3*R3 + w4*R
You wrote MAXIMIZE this function, why not using the maximize option of
constrOptim?
If you read the help file, you will find that if you set the control fnscale
to a negative value, maximisation
is performed.
constrOptim(c(1,1),neg_loglik, grad=NULL, ui=rbind(c(1,0),c(0,1)),
ci=c(0,0),control=li
I'm an Italian student looking for help.
How can I maximize this function?
neg_loglik<-function(param){
a<-param[1]
b <-param[2]
-(log(pr)-(a*s2)-(b*s)+n*log(2*a)-n*log(1-(b/sqrt(a))*exp((b^2)/(4*a))*(sqrt
(pi))*(1-pnorm(b/(2*sqrt(a)), mean=0, sd=1))*1))
}
Con
> pr
Hi Daniela,
Will the "optim" function with the method "L-BFGS-B" work for you?
Look for the "lower" argument in the function.
Ritwik
On Fri, Jul 25, 2008 at 9:07 AM, Daniela Garavaglia
<[EMAIL PROTECTED]> wrote:
>
> I'm looking for a R function which can maximise this logliklihood function,
> un
Daniela Garavaglia virgilio.it> writes:
>
> I'm looking for a R function which can maximise this logliklihood function,
> under the constraits a>0 e b>0
>
> f<-function(param){
>
> a<-param[1]
>
> b <-param[2]
>
> log(prod)-(a*s2)-(b*s)-n*log(1-((0.5*b/sqrt(a))*(exp((b^2)/(4*a)))*((sqrt(
I'm looking for a R function which can maximise this logliklihood function,
under the constraits a>0 e b>0
f<-function(param){
a<-param[1]
b <-param[2]
log(prod)-(a*s2)-(b*s)-n*log(1-((0.5*b/sqrt(a))*(exp((b^2)/(4*a)))*((sqrt(pi
))*(1-pnorm(-b/(2*sqrt(a)), mean=0, sd=1)}
I've tri
18 matches
Mail list logo