Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

So I have one vector of alpha, one vector of beta, and I am trying to find a theta for when the sum of all the estimates (for alpha's i to n and beta's i to n) equals 60.

Basically what I did is start from theta = 0.0001, and iterate through, calculating all these sums, and when it is lower than 60, continue by adding 0.0001 each time, while above 60 means we found the theta.

I found the value theta this way. Problem is, it took me about 60 seconds using Python, to find a theta of 0.456.

What is quicker approach to find this theta (since I would like to apply this for other data)?

share|improve this question
    
It is very hard to understand what you're asking. Please explain what you're trying to achieve, using standard notation and terminology. –  yohBS Mar 18 '13 at 15:21
    
@yohBS Does this help? –  Dualinity Mar 18 '13 at 15:54
add comment

2 Answers

Define

$$f(\theta)=\sum_{i=1}^{N}\frac{e^{\alpha_i(\theta-\beta_i)}}{1+e^{\alpha_i(\theta-\beta_i)}}-60$$

You want to find a $\theta$ for which $f(\theta)=0$. This is a common task, and is called root finding. There are numerous ways to achieve that, and python (scipy) has a built in function that does that - fsolve.

share|improve this answer
add comment

I used the bisectional method for finding the root.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.