Non-Linear Regression with two Predictors

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

Non-Linear Regression with two Predictors

Berlinerfee
Hello there,

I am using nls the first time for a non-linear regression with a
logistic growth function:
startparam <- c(alpha=3e+07,beta=4000,gamma=2)
fit <- nls(dataset$V2~(( alpha / ( 1 + exp( beta - gamma * dataset$V1 )
) ) ),data=dataset,start=startparam)

Everything works fine and i get good results. Now I would like to
improve the results using my DUMMY Variable (dataset$V6) the runs half
of the time 0 and then 1. This is my new nls:
startparam <- c(alpha=3e+07,beta=4000,gamma=2,delta=1000000)
fit <- nls(dataset$V2~(( alpha / ( 1 + exp( beta - gamma * dataset$V1 )
) ) + (dataset$V6*dataset$V1*delta) ),data=dataset,start=startparam)

I get "Singular Gradient Matrice". May anyone give me the right nls
function for this problem??

Regards

______________________________________________
[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: Non-Linear Regression with two Predictors

Berlinerfee
Hi and thank you for your reply,

in my new regression formular the parameter delta is inserted:
fit <- nls(dataset$V2~(( alpha / ( 1 + exp( beta - gamma* dataset$V1 ) )
) + (dataset$V6*delta)),data=dataset,start=startparam)

The sense is, that dataset$V6 is a dummy variable that represents the
german reunion. I expect, that the delta in the regression is about
1.000.000 because of the reunion. The logistic function thus has a jump
at this point. But I would like to get the exact paramter value for
delta (the jump) as the parameters for the logistic function of growth
(alpha to gamma). The partial derivative to delta would be like a
stair-function. It is 0 until 1990 and 1 there after.

Any idea? Thank you!

Regards

Moshe Olshansky schrieb:

> Hi,
>
> I believe that since delta does not appear in the function you are optimizing, it's partial derivative with respect to delta is always 0 and so the gradient is singular.
> Why do you need delta at all?
>
> --- On Mon, 27/7/09, Berlinerfee <[hidden email]> wrote:
>
>  
>> From: Berlinerfee <[hidden email]>
>> Subject: [R] Non-Linear Regression with two Predictors
>> To: [hidden email]
>> Received: Monday, 27 July, 2009, 2:52 AM
>> Hello there,
>>
>> I am using nls the first time for a non-linear regression
>> with a logistic growth function:
>> startparam <- c(alpha=3e+07,beta=4000,gamma=2)
>> fit <- nls(dataset$V2~(( alpha / ( 1 + exp( beta - gamma
>> * dataset$V1 ) ) ) ),data=dataset,start=startparam)
>>
>> Everything works fine and i get good results. Now I would
>> like to improve the results using my DUMMY Variable
>> (dataset$V6) the runs half of the time 0 and then 1. This is
>> my new nls:
>> startparam <-
>> c(alpha=3e+07,beta=4000,gamma=2,delta=1000000)
>> fit <- nls(dataset$V2~(( alpha / ( 1 + exp( beta - gamma
>> * dataset$V1 ) ) ) + (dataset$V6*dataset$V1*delta)
>> ),data=dataset,start=startparam)
>>
>> I get "Singular Gradient Matrice". May anyone give me the
>> right nls function for this problem??
>>
>> Regards
>>
>> ______________________________________________
>> [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.
>>
>>    
>
>  


        [[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.