Size of subsample in ecodist mantel()

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Size of subsample in ecodist mantel()

Nevil Amos
What is the size of the boostrapped subsample in  ecodist mantel()

thanks

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Strating value problem for CG in optim()

nataraj

Dear list-members,

I have done optimization of 3 parameters by maximum likelihood method using conjugate gradient as optimizer. Since I have the reported value of the parameters from an article, I can validate the result of the optimized parameters. The problem is that optimizer converges to the desirable value. (as reported in the article) only for a certain starting value.

If the staring value of the parameters are like (2,1,1) then the value of parameters the function converges is
$par
[1] -0.4169408 -0.2800828  2.9614670

And the value is close to the value of article reported in the article
Vs = 0.4861 ; Vn = 0.1478 and m is some positive value (no value mentioned in the article)

And If I fine tune the starting value from (2,1,1) to (1.949,1.13,1) then I get the value of the parameters very close to the one reported.

$par
[1] -0.4700892 -0.1428245  2.9614670

Now the question is how I can find the starting values for the test experiment for which I am going to implement this optimization procedure.
Is there any function to be wrapped with optim() to find the right starting value.



Regards,
B.Nataraj

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Size of subsample in ecodist mantel()

Sarah Goslee
In reply to this post by Nevil Amos
You can set it using the pboot argument.

Sarah

On Thursday, June 28, 2012, nevil amos wrote:

> What is the size of the boostrapped subsample in  ecodist mantel()
>
> thanks
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] <javascript:;> mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>


--
Sarah Goslee
http://www.stringpage.com
http://www.sarahgoslee.com
http://www.functionaldiversity.org

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Strating value problem for CG in optim()

Ruben
In reply to this post by nataraj
Hi,

It isn't surprising that convergence results depend on initial par
values in a nonlinear optimization problem. There might be local maxima
in the landscape defined by your likelihood function and you have to
explore it for the proper starting places.

One suggestion is to try many different sets of initial values and
select the best ones by, for each convergence result, examining the
value of the maximized function, the gradients of the parameters at the
maximized value, the standard errors of the parameters, the correlation
matrix between parameter estimates.

Also, if you use optimx (from package optimx) as your wrapper, you can
check the Karush-Kuhn-Tucker (KKT) conditions, and try several numerical
methods (not just CG) in one go.

HTH

Ruben

On 6/28/2012 12:54 PM, [hidden email] wrote:
>
> Dear list-members,
>
> I have done optimization of 3 parameters by maximum likelihood method using conjugate gradient as optimizer.
Since I have the reported value of the parameters from an article, I can
validate the result of the optimized
parameters. The problem is that optimizer converges to the desirable
value. (as reported in the article) only
for a certain starting value.
>
> If the staring value of the parameters are like (2,1,1) then the value of parameters the function converges is
> $par
> [1] -0.4169408 -0.2800828  2.9614670
>
> And the value is close to the value of article reported in the article
> Vs = 0.4861 ; Vn = 0.1478 and m is some positive value (no value mentioned in the article)
>
> And If I fine tune the starting value from (2,1,1) to (1.949,1.13,1) then I get the value of the parameters
very close to the one reported.
>
> $par
> [1] -0.4700892 -0.1428245  2.9614670
>
> Now the question is how I can find the starting values for the test experiment for which I am going to implement
this optimization procedure.

> Is there any function to be wrapped with optim() to find the right starting value.
>
>
>
> Regards,
> B.Nataraj
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

--
Ruben H. Roa-Ureta, Ph. D.
Senior Scientist
Marine Studies Section, Center for Environment and Water,
Research Institute, King Fahd University of Petroleum and Minerals,
KFUPM Box 1927, Dhahran 31261, Saudi Arabia
Office Phone : 966-3-860-7850
Cellular Phone : 966-5-61151014

Save a tree. Don't print this e-mail unless it's really necessary

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Size of subsample in ecodist mantel()

Nevil Amos
In reply to this post by Sarah Goslee
Thanks Sarah,

It is not clear to me exactly how I set this value. if I enter a value for
pboot then the ulim==llim

> X<-dist(1:100)> Y<-dist(1:100+50*rnorm(100))> length(X)[1] 4950> print(mantel(X~Y,nperm=1000,nboot=1000,pboot=10))   mantelr      pval1      pval2      pval3  llim.2.5% ulim.97.5%
 0.1396906  0.0010000  1.0000000  0.0010000  0.1396906  0.1396906



if I do not set a value for pboot then
 as expected ulim>llim

> print(mantel(X~Y,nperm=1000,nboot=1000))   mantelr      pval1      pval2      pval3  llim.2.5% ulim.97.5%
 0.1396906  0.0010000  1.0000000  0.0010000  0.1005011  0.1805416



What is the default for pboot?

this does not appear to be dealt with in  help for mantel



On Thu, Jun 28, 2012 at 8:35 PM, Sarah Goslee <[hidden email]>wrote:

> You can set it using the pboot argument.
>
> Sarah
>
>
> On Thursday, June 28, 2012, nevil amos wrote:
>
>> What is the size of the boostrapped subsample in  ecodist mantel()
>>
>> thanks
>>
>>        [[alternative HTML version deleted]]
>>
>> ______________________________________________
>> [hidden email] mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
>
>
> --
> Sarah Goslee
> http://www.stringpage.com
> http://www.sarahgoslee.com
> http://www.functionaldiversity.org
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Strating value problem for CG in optim()

nataraj
In reply to this post by Ruben
Thanks Ruben and John for replying to me. I am trying Rcgmin as suggested by John Nash with numerical gradient but the result converged so for not close to what I got in CG implemented in optim( ) and I have to find the analytical gradient equation for multivariate Gaussian distribution. Is this function available in R already?

Ruben , In my current approach, all possible starting value of parameters converges to the value of objective function to $value 23.25272 however I am trying to look up to other parameters to justify the predicted parameters.

I have one more doubts, my objective function returning negative value to optim() in order to consider it as maximizer, does that mean it also return the parameter as negative value ?

Thanks!
B.Nataraj



-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Ruben
Sent: Thursday, June 28, 2012 4:18 PM
To: [hidden email]
Subject: Re: [R] Strating value problem for CG in optim()

Hi,

It isn't surprising that convergence results depend on initial par
values in a nonlinear optimization problem. There might be local maxima
in the landscape defined by your likelihood function and you have to
explore it for the proper starting places.

One suggestion is to try many different sets of initial values and
select the best ones by, for each convergence result, examining the
value of the maximized function, the gradients of the parameters at the
maximized value, the standard errors of the parameters, the correlation
matrix between parameter estimates.

Also, if you use optimx (from package optimx) as your wrapper, you can
check the Karush-Kuhn-Tucker (KKT) conditions, and try several numerical
methods (not just CG) in one go.

HTH

Ruben

On 6/28/2012 12:54 PM, [hidden email] wrote:
>
> Dear list-members,
>
> I have done optimization of 3 parameters by maximum likelihood method using conjugate gradient as optimizer.
Since I have the reported value of the parameters from an article, I can
validate the result of the optimized
parameters. The problem is that optimizer converges to the desirable
value. (as reported in the article) only
for a certain starting value.
>
> If the staring value of the parameters are like (2,1,1) then the value of parameters the function converges is
> $par
> [1] -0.4169408 -0.2800828  2.9614670
>
> And the value is close to the value of article reported in the article
> Vs = 0.4861 ; Vn = 0.1478 and m is some positive value (no value mentioned in the article)
>
> And If I fine tune the starting value from (2,1,1) to (1.949,1.13,1) then I get the value of the parameters
very close to the one reported.
>
> $par
> [1] -0.4700892 -0.1428245  2.9614670
>
> Now the question is how I can find the starting values for the test experiment for which I am going to implement
this optimization procedure.

> Is there any function to be wrapped with optim() to find the right starting value.
>
>
>
> Regards,
> B.Nataraj
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

--
Ruben H. Roa-Ureta, Ph. D.
Senior Scientist
Marine Studies Section, Center for Environment and Water,
Research Institute, King Fahd University of Petroleum and Minerals,
KFUPM Box 1927, Dhahran 31261, Saudi Arabia
Office Phone : 966-3-860-7850
Cellular Phone : 966-5-61151014

Save a tree. Don't print this e-mail unless it's really necessary

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Size of subsample in ecodist mantel()

Sarah Goslee
In reply to this post by Nevil Amos
pboot is the proportion of the sample to select, and so if it's
greater than or equal to 1 you're using the entire sample rather than
a subsample, so of course the limits are equal.

If you look at the usage line in the help for mantel, where defaults
are given, the default for pboot = 0.9.

The details are discussed in the associated JSS paper that is given by
citation("ecodist")

Sarah

On Thu, Jun 28, 2012 at 9:28 PM, nevil amos <[hidden email]> wrote:

> Thanks Sarah,
>
> It is not clear to me exactly how I set this value. if I enter a value for
> pboot then the ulim==llim
>
>> X<-dist(1:100)
>> Y<-dist(1:100+50*rnorm(100))
>> length(X)
> [1] 4950
>> print(mantel(X~Y,nperm=1000,nboot=1000,pboot=10))
>    mantelr      pval1      pval2      pval3  llim.2.5% ulim.97.5%
>  0.1396906  0.0010000  1.0000000  0.0010000  0.1396906  0.1396906
>
>
>
> if I do not set a value for pboot then
>  as expected ulim>llim
>
>
>> print(mantel(X~Y,nperm=1000,nboot=1000))
>    mantelr      pval1      pval2      pval3  llim.2.5% ulim.97.5%
>  0.1396906  0.0010000  1.0000000  0.0010000  0.1005011  0.1805416
>
>
>
> What is the default for pboot?
>
> this does not appear to be dealt with in  help for mantel
>
>
>
> On Thu, Jun 28, 2012 at 8:35 PM, Sarah Goslee <[hidden email]>
> wrote:
>>
>> You can set it using the pboot argument.
>>
>> Sarah
>>
>>
>> On Thursday, June 28, 2012, nevil amos wrote:
>>>
>>> What is the size of the boostrapped subsample in  ecodist mantel()
>>>
>>> thanks
>>>

--
Sarah Goslee
http://www.functionaldiversity.org

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.