Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

How would you do it?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How would you do it?

    Suppose you had a database in which 4 tables with data. Let's call them table A,B,C,D.
    In each of those 4 tables the common field is the date field, because all tables hold events that have occurred on a specific date. It is likely but not mandatory or guaranteed, that every date is present, events within the database occur every day. Each table also holds "a value" which is related to that date.

    There is a fifth table which holds "results", table E.
    Now, the data in table E are "measurements". Values in table E are measured on a daily basis. But: the data in tables A till D is of influence to the result that will be measured on a given day in table E. We do not know exactly in which way, we do not know the formula of the relationship. The factors that are in table A,B,C,D relate in some way also to eachother. Relationship also unknown, or at least, not exactly known. But we DO know, how in the past the changes in values within the data in table A, B, C, and D resulted in a value in table E. That is historical information. We can see what value table E held on f.e. sunday, and we can then see how the value in tables A till D were on sunday. We could then calculate the relation between A and B, A and C, A and D, and so on, and relate that to the result that has been measured in table E.

    What I want to do, is by extrapolation predict the results in each table A, B, C and D, and from that extrapolation, again by extrapolation, predict the results in table E for, let's say, a week.

    Now, because of the fact that the data in tables A till D are also dependend of several factors outside the tables known, I think it is difficult to use a linear extrapolation function. It could be that we need to use a second order polynome or an exponential function to extrapolate, but, I do not know for sure how to proceed.

    How would you guys tackle this problem, and what kind of code would be needed to solve the puzzle?

  • #2
    Re: How would you do it?

    I was going to be flippant and simply post, "Huh?" but that wouldn't get anyone anywhere.

    Would you be willing to give an example of the data?

    Comment


    • #3
      Re: How would you do it?

      It is a mathematical problem, an example of the data would not get you anywhere. The data is namely just numbers and dates, like for table A:

      date: 20-09-2008
      value: 24,6

      This could be solved easily by a guy who has knowledge of things like exponential function extrapolation (however that is part of the question: should you use an exponential function here or a polygonome or what) I guess, and who has knowledge and experience with Alpha to know how to encode such formula.

      Comment


      • #4
        Re: How would you do it?

        From your explanation it sounds as if you are not looking for a programmer but a mathematician.
        Andrew

        Comment


        • #5
          Re: How would you do it?

          That's correct. But you would be surprised to know how many specialized guys we have in the Alpha user group.... we have mathematicians, I hope they can shed some light on this so I can get my programmers hand around it....

          Comment


          • #6
            Re: How would you do it?

            Richard,
            More info needed.

            To fully understand how the table's fields interact with each other---your comment of
            Each table also holds "a value" which is related to that date.
            .what if no date? How is it related--how is its value determined??

            How are the measurements of the 5th table influenced? That is, numerically? whether it appears or not?? whether it is negative??? endless really.

            You say you do not know.

            Your question, as I read it, is to try and come up with a mathematical expression or formula to attempt to determine these relationships--a model actually. Without the data, how can we help figure this out?? Short answer is we can't.

            Unless you are maybe asking How you should proceed to try to figure out the relationship....then again, without the data in front of us, it is just pure speculation as to what would work.

            The first thing to do is to see if anything can be broken down into parts. Then search for a pattern, whether linear, exponential, logrithmic, whatever.
            Mike
            __________________________________________
            It is only when we forget all our learning that we begin to know.
            It's not what you look at that matters, it's what you see.
            Henry David Thoreau
            __________________________________________



            Comment


            • #7
              Re: How would you do it?

              Richard,

              Mike is totally correct.

              It sounds as if there is a program sticking dates and numbers in tables and only the programmer knows where and why.

              The where and why are very important to solving any problem, mathmatical or not. The dates seve for the when.

              Putting together a set of tables for data by using a date is ok if there will only be one set of data entered perday, but not if there are several data records entered per date. If you have little data, a linking field in each table would not be a bad idea. Maybe you have one, and we don't know about it??

              .
              Dave Mason
              [email protected]
              Skype is dave.mason46

              Comment


              • #8
                Re: How would you do it?

                It is not that difficult in terms of data. Let me explain you some more.

                Table A is a table that holds measured temperatures in degrees Celsius. Like this:

                01-09-2009, 21.1
                02-09-2009, 19.5
                03-09-2009, 18.5
                04-09-2009, 22.0

                Table B is a table that holds measured hours of sunshine.
                Like this:

                01-09-2009, 6.0
                02-09-2009, 4.5
                03-09-2009, 3.5
                04-09-2009, 6.1

                Table C is a table that holds measured water temperatures.
                Like this:

                01-09-2009, 22.0
                02-09-2009, 21.8
                03-09-2009, 21.4
                04-09-2009, 22.1

                Table D is a table that holds wind speed measurements in Beaufort.
                Like this:

                01-09-2009, 2
                02-09-2009, 3
                03-09-2009, 3
                04-09-2009, 1

                Now, the "results table", table E, is a table that holds the number of visitors to the pool.
                Like this:

                01-09-2009, 6.000
                02-09-2009, 4.350
                03-09-2009, 4.100
                04-09-2009, 6.200

                Now, maybe you now see, that there is no relation between the data internally in the tables A, B, C, and D amongst itself.
                A lot of external factors are however influencing the values that are present in those tables. They are simply measured.
                On a given date. We do not know, why the wind was 2 Beaufort. It might very well be analyzed by experts, but WE do not know and have no further information on that. We just know it was 2 Beaufort because we measured it on 01-09-2009 with a wind speed meter.

                We assume, that there is a connection between:
                * temperature
                * sunshine
                * wind speed
                * water temperature

                We also assume, that this connection will influence to some extend the number of visitors that are measured (by actually counting them at the reception desk of the pool).
                Because we think that people will be more inclined to visit the pool as the sun is shining more hours, the wind is more down, the temperature is higher etc etc.

                There is a trend in each table.
                If it is 25 degrees Celsius today, it is unlikely that it will freeze tomorrow. We can calculate the expected trend by extrapolation on a linear basis within a bandwidth determined by the maximum discrepancy between two up following dates in the table. And so on. So, we can, by the results of the table until today, make a prediction of the temperature tomorrow.
                How accurate this will be, is quite another question, there is a "noise" in the calculation, but this is always the case in extrapolation mathematics. We do never know the noise exactly.

                Suppose we could, in this way, extrapolate the data in all tables, then, we could maybe also predict the value that will appear in table E tomorrow.....

                That is the question. How do we do that, mathematically, and how do we transfer the mathematics into xbasic....

                I hope I was more clear now, I did my best to.... :-)

                Comment


                • #9
                  Re: How would you do it?

                  Richard:
                  What you are looking for is precisely what the National Weather Center does in their computer models to predict Hurricanes and weather patterns, perhaps not to that extent but to a smaller degree.

                  This falls into the vast (enormously vast) world of statistical analysis and all of its enormously vast methods of predictive analysis. You can't even begin to scratch the surface of this science. It is certainly a human obsession since the dawn of time because if there were a good model to follow then you could predict the outcome of a game, a horse race, the stock market, or the price of any commodity or anything for that matter. Insurance companies try that all the time with actuaries who try to predict how long you will live, what are the chance your house will catch on fire....etc.

                  Of course no one has ever come close, but you could try.

                  Unfortunately alpha has very few of any statistical functions. Perhaps Standard Deviation, variance..etc. Excel has more functions like distribution, pivotal tables..etc.

                  You could develop your own functions. Something as simple as a moving average or a bit complicated like Least Square or Linear Regression.

                  Realistically speaking, I would suggest you use a statistical software (they are not cheap), but you might find one not too elaborate or even a shareware (doubt it).
                  Last edited by G Gabriel; 09-02-2009, 12:09 PM.

                  Comment


                  • #10
                    Re: How would you do it?

                    Richard,

                    Or use the weather forecast of whatever site you want. Scrape the data from the site into Alpha, and make your predictions from them....should make it much more straightforward for you to develop what you want.
                    Mike
                    __________________________________________
                    It is only when we forget all our learning that we begin to know.
                    It's not what you look at that matters, it's what you see.
                    Henry David Thoreau
                    __________________________________________



                    Comment


                    • #11
                      Re: How would you do it?

                      Hi Mike,

                      Well it is not the data that I am worried about, it is the prediction itself. How to encode it?

                      If for any (mathematical) function "f" only an ending range of data points is known, like for you would need to predict a function value f(a) for x=a where a is outside the x values known. Which would be a normal mathematical function for extrapolation.
                      But is this the right approach? Or could one better go exponential? There is no exact model.

                      Using Alpha one could use the summarize average function, but that would not be an extrapolation, just an average.

                      So, there is no standard Alpha function you can use, you need to create your own one based upon the mathematical formula that suits your needs. Both are in question here. What formula would suit the needs most? And how to encode it?

                      I know we have guys who could (and maybe easily as well) crack this nut just for fun. I just hope they are looking at this and think "well lets help the poor b*st*rd out of his misery"..... :-)

                      This is half a mathematical thing, half an Alpha thing. You can not crack it with just either one side of the knowledge.
                      Last edited by MRichard; 09-02-2009, 05:42 PM.

                      Comment


                      • #12
                        Re: How would you do it?

                        Richard,
                        If you obtained the forecast data as I stated (and would do it this way if my problem), then divide and conquer as any problem. I would think that even a line graph of the parameter data and the result table data should shed some light on how much each of the parameters actually affect the result---you could statistically analyze this to give a "weight" to each parameter or even just figure it out approximately by trial and error. Once a parameter has a weight factor, then using the forecast data you will have your prediction.

                        A bit simplistic (and easier said than done!), but is how I see it in my head at least!!! :)
                        Mike
                        __________________________________________
                        It is only when we forget all our learning that we begin to know.
                        It's not what you look at that matters, it's what you see.
                        Henry David Thoreau
                        __________________________________________



                        Comment


                        • #13
                          Re: How would you do it?

                          Originally posted by G Gabriel View Post
                          Richard:
                          What you are looking for is precisely what the National Weather Center does in their computer models to predict Hurricanes and weather patterns, perhaps not to that extent but to a smaller degree.

                          This falls into the vast (enormously vast) world of statistical analysis and all of its enormously vast methods of predictive analysis. You can't even begin to scratch the surface of this science. It is certainly a human obsession since the dawn of time because if there were a good model to follow then you could predict the outcome of a game, a horse race, the stock market, or the price of any commodity or anything for that matter. Insurance companies try that all the time with actuaries who try to predict how long you will live, what are the chance your house will catch on fire....etc.

                          Of course no one has ever come close, but you could try.

                          Unfortunately alpha has very few of any statistical functions. Perhaps Standard Deviation, variance..etc. Excel has more functions like distribution, pivotal tables..etc.

                          You could develop your own functions. Something as simple as a moving average or a bit complicated like Least Square or Linear Regression.

                          Realistically speaking, I would suggest you use a statistical software (they are not cheap), but you might find one not too elaborate or even a shareware (doubt it).
                          Mr. Gabriel, thank you for taking the time to reply to this post! It is not that you could actually predict an outcome like the horse races using an extrapolation..... you would be making an informed guess. Because an extrapolation narrows your field of likely options. And that about says it all: "likely" and "narrows". You still would have a lot of options left on the one hand, and on the other hand, who says the likely will occur?

                          However, this is just the basis of the solution.....

                          When you start extrapolating, you can also start evaluating the extrapolation predictions towards the realized figures and you might be able to calculate the formula which defines "the noise" in the formula. Next step: A.I. to manipulate the extrapolation function with the evaluation data :-)

                          Comment


                          • #14
                            Re: How would you do it?

                            There is a pool, this pool needs to be staffed with lifeguards. You need a set number of lifeguards based on the number of people in the pool. It is economically in-efficient to staff 100 lifeguards if you only need 10. Likewise patrons get upset if you only have 10 lifeguards but have 1000 people. So you need a method to predict how many people will come to the pool based on the weather conditions.

                            You are looking for a mathematical formula that will calculate and give you a reasonable estimate based on weather forecasts.

                            You have historical data that can be used in developing of the formula.

                            I am a programmer, you give me the formula and I write you an xbasic function that will simulate the formula.

                            In this case you don't have the formula and are in need of someone to develop the formula for you. I am not sure the you will get the best responses from this forum in this regard. I suggest looking for someone who works in the statistical analysis field and ask them for help in developing the formula. Once that is developed I am sure that there are individuals here who will be more than willing in helping you convert the formula into an xbasic function.
                            Andrew

                            Comment


                            • #15
                              Re: How would you do it?

                              This is half a mathematical thing, half an Alpha thing.
                              Even more than this if you still plan on doing the entire prediction model yourself. As example you stated
                              So, we can, by the results of the table until today, make a prediction of the temperature tomorrow.
                              ---I totally disagree with this premise. Just a cold front moving in changes everything---there is no way to predict the weather based on what happened today or even yesterday. You may get close, but think rarely would come close to what is needed for a predictive model. OTOH using an existing weather forecast should give better results overall.
                              Mike
                              __________________________________________
                              It is only when we forget all our learning that we begin to know.
                              It's not what you look at that matters, it's what you see.
                              Henry David Thoreau
                              __________________________________________



                              Comment

                              Working...
                              X