FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Forum index » Science and Technology » Math » num-analysis
Help in identifying a numerical method
Post new topic   Reply to topic Page 1 of 1 [3 Posts] View previous topic :: View next topic
Author Message
Don11135
science forum beginner


Joined: 24 Mar 2005
Posts: 18

PostPosted: Fri Jul 21, 2006 11:34 am    Post subject: Re: Help in identifying a numerical method Reply with quote

You're right, sum1 = sum2 = 0 to start with. The only thing I left out
is that d_i and d_j are both rounded values:

double d_i = round(x[i] / e) // to nearest integer
double d_j = round(x[j] / e) // to nearest integer

highegg wrote:
Quote:
Don wrote:
I was provided with some code for refining the estimate of a initial
value, but I have no clue to what class of numerical method this
belongs. Any suggestions would be greatly appreciated. As you can
tell, I'm not a mathematician, just a programmer trying to understand
some code implementation.

Here's the code:

If I have an array of values, x[] and an initial estimated value e,
which all the values in the x array have a relationship to, then

double sum1, sum2

I guess you're missing
sum1 = sum2 = 0
here. Am I right?


for(i = 0; i < x.length; i++)
{
double d_i = x[i] / e

for(j = 0; j < x.length; j++)
{
double val = min(i + 1, j + 1) - ((i+1)*(j+1)) / (x.length + 1)

double d_j = x[j] / e

NOTE: at this point, d_i == x[i]/e
sum1 += val * d_j * x[i]
sum2 += val * d_j * d_i
}
}

// finally the refined value

finalValue = sum1 / sum2

At each update of sum1 and sum2, the increment for sum1 is e times the
increment for sum2.
Therefore, sum1/sum2 should be e (up to roundoff). Did you reproduce
the code correctly?
Jaroslav
Back to top
highegg
science forum beginner


Joined: 11 Feb 2005
Posts: 5

PostPosted: Fri Jul 21, 2006 5:09 am    Post subject: Re: Help in identifying a numerical method Reply with quote

Don wrote:
Quote:
I was provided with some code for refining the estimate of a initial
value, but I have no clue to what class of numerical method this
belongs. Any suggestions would be greatly appreciated. As you can
tell, I'm not a mathematician, just a programmer trying to understand
some code implementation.

Here's the code:

If I have an array of values, x[] and an initial estimated value e,
which all the values in the x array have a relationship to, then

double sum1, sum2

I guess you're missing
sum1 = sum2 = 0
here. Am I right?

Quote:

for(i = 0; i < x.length; i++)
{
double d_i = x[i] / e

for(j = 0; j < x.length; j++)
{
double val = min(i + 1, j + 1) - ((i+1)*(j+1)) / (x.length + 1)

double d_j = x[j] / e

NOTE: at this point, d_i == x[i]/e
sum1 += val * d_j * x[i]
sum2 += val * d_j * d_i
}
}

// finally the refined value

finalValue = sum1 / sum2

At each update of sum1 and sum2, the increment for sum1 is e times the

increment for sum2.
Therefore, sum1/sum2 should be e (up to roundoff). Did you reproduce
the code correctly?
Jaroslav
Back to top
Don11135
science forum beginner


Joined: 24 Mar 2005
Posts: 18

PostPosted: Thu Jul 20, 2006 8:56 pm    Post subject: Help in identifying a numerical method Reply with quote

I was provided with some code for refining the estimate of a initial
value, but I have no clue to what class of numerical method this
belongs. Any suggestions would be greatly appreciated. As you can
tell, I'm not a mathematician, just a programmer trying to understand
some code implementation.

Here's the code:

If I have an array of values, x[] and an initial estimated value e,
which all the values in the x array have a relationship to, then

double sum1, sum2

for(i = 0; i < x.length; i++)
{
double d_i = x[i] / e

for(j = 0; j < x.length; j++)
{
double val = min(i + 1, j + 1) - ((i+1)*(j+1)) / (x.length + 1)

double d_j = x[j] / e

sum1 += val * d_j * x[i]
sum2 += val * d_j * d_i
}
}

// finally the refined value

finalValue = sum1 / sum2

In the first iteration of the j loop, the numerator is increasing by
one (1,2,3,4,5..), in the 2nd iteration, the numerator increases by 2
(2,4,6,8...), in the 3rd iteration, the numerator increases by 3
(3,6,9,12...) and so on. The net result is that val becomes some type
of weighting scheme that is applied to both sum1 and sum2. Eventually,
the final value is calculated by dividing sum1 by sum2.

It appears to me to a way to statistically refine an estimated value.

Thanks in advance,

Don
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [3 Posts] View previous topic :: View next topic
The time now is Thu Oct 30, 2014 3:38 am | All times are GMT
Forum index » Science and Technology » Math » num-analysis
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts troubles in determination of specific surface area(air pe... eos Chem 0 Thu Jul 20, 2006 10:05 am
No new posts troubles in determination of specific surface area(air pe... eos Chem 0 Thu Jul 20, 2006 10:02 am
No new posts possible to use Generalized Method of Moments for this pr... comtech Math 1 Thu Jul 20, 2006 12:49 am
No new posts Power Method and negative eigenvalues Skunk num-analysis 7 Wed Jul 19, 2006 10:19 pm
No new posts modelling method for categorical data Arby Math 1 Wed Jul 19, 2006 12:09 pm

Copyright © 2004-2005 DeniX Solutions SRL
Other DeniX Solutions sites: Electronics forum |  Medicine forum |  Unix/Linux blog |  Unix/Linux documentation |  Unix/Linux forums  |  send newsletters
 


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0624s ][ Queries: 20 (0.0339s) ][ GZIP on - Debug on ]