Thread Subject: maximize a function with two variables

Subject: maximize a function with two variables

From: Erik

Date: 19 Nov, 2009 00:15:18

Message: 1 of 1

I am trying to maximize the Llikef function below. (min the negative of the function). However, I am getting the error below. Does anybody have suggestions on how I could max the function below? I have tried other methods, but they are not estimating my parameters very well. I've tried the method of moments and proportions. I am looking for another function in MATLAB.

Llikef = @(that)-sum(log(max(that(1),.00001).^(x.^max(that(2),.00001))-max(that(1),.00001).^((x+1).^max(that(2),.00001))));
that0 = [0.5 1];
[that,Llikef] = fminsearch(Llikef,that0);

I am getting the error below:
Warning: Log of zero.
> In meansamavg2>@(that)-sum(log(max(that(1),.00001).^(x.^max(that(2),.00001))-max(that(1),.00001).^((x+1).^max(that(2),.00001)))) at 197
  In fminsearch at 339
  In meansamavg2 at 203

Thanks,
Erik

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us at files@mathworks.com