+ Reply to Thread
Results 1 to 11 of 11

Advice required...Excel's ability to create a user interactive simulation module...

  1. #1
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,192

    Advice required...Excel's ability to create a user interactive simulation module...

    Morning All

    I am looking for advice on whether the simulation in the link below can ever be achieved by making use of Excel VBA...
    Site will not allow me to attach link as per usual...

    https://seeing-theory.brown.edu/freq....html#section2

    In Chapter 4, go to the Confidence Interval module and choose “Normal” distribution, n = 10 and 1 – α = 0.95.
    Then select “start sampling”.

    Thank you in advance for your valuable input and suggestions...
    Last edited by sintek; 11-03-2018 at 06:48 AM. Reason: Empty post removed
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  2. #2
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,192

    Re: Advice required...Excel's ability to create a user interactive simulation module...

    Anyone have any thoughts...Perhaps some links that might assist...

  3. #3
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,192

    Re: Advice required...Excel's ability to create a user interactive simulation module...

    https://seeing-theory.brown.edu/freq....html#section2
    Nobody...Really...That's a first...

  4. #4
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,819

    Re: Advice required...Excel's ability to create a user interactive simulation module...

    Short but useless answer -- I am not a web/javascript programmer, but it looks like they are using javascript to perform the simulation. I know next to nothing about javascript, but I don't see that they are doing anything magically unique to javascript that could not be translated into VBA (or Excel worksheet functions or python or any other programming language). My short, useless, yes/no answer is, yes, it is possible to do something like this in VBA.

    The linked website does not offer much explanation of what they are doing, and I am not enough of a statistician to easily infer what they are doing from the visualization alone. It looks like they are illustrating some kind of resampling technique (https://en.wikipedia.org/wiki/Resampling_(statistics) ). As with a lot of programming problems, I like to break it down into a flowchart or outline before I tackle the actual programming.

    1) Assuming this is about resampling techniques, figure out and research the kind of resampling techniques you want to put into this. Also identify the essential and important elements of the project (for example, is the animation essential to your project).
    2) Once you understand conceptually what you need to do.
    3) Resampling -- seems to usually involve a) generating uniform random numbers (VBA's Rnd() function), then using those numbers to resample the distribution or sample set.
    4) Compute and store statistics for the resampled set.
    5) Work out visualization and animation aspects of the project.

    None of the details for this are clear to me, so I don't yet have any specific recommendations. With that outline, what parts are you having trouble with?
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  5. #5
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,192

    Re: Advice required...Excel's ability to create a user interactive simulation module...

    Hi MrShorty

    Tx for you input...I am currently developing a 21 module Statistical Analytical Add-in with the below components...
    The next step...if possible...was a requirement to make use of the module outputs to create the visual simulation of each module below...
    This link was an example of what the client was wanting...Was just enquiring if someone had ever come accross something similar which might give me an indication of how visuals in excel works...i.e. using data and loops to create the consistent visuals...
    Please Login or Register  to view this content.

    Came across a site... which has a few examples...See attached...
    None as elaborate as the link in above post...
    http://iris.nyit.edu/~fgordon/Statis...imulations.htm


    what parts are you having trouble with?
    In my first link, I can easily replicate the left side Bar chart with randomizing...
    The right side chart is what is baffling me...How would one achieve such visuals - if at all possible...I mean what kind of chart would be used to replicate such an output???
    Attached Files Attached Files
    Last edited by sintek; 11-03-2018 at 01:34 PM.

  6. #6
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,819

    Re: Advice required...Excel's ability to create a user interactive simulation module...

    The right side chart is what is baffling me...How would one achieve such visuals - if at all possible...I mean what kind of chart would be used to replicate such an output???
    It looks to me like a "basic" XY scatter chart. What exactly do you find baffling? Drawing the distribution (static) should be straightforward. The "difficult" parts are probably the animation parts. I would expect a static (non-changing) data series for visualizing the distribution. If you don't need the animation, draw the random sample/resample sets as another data series (at a suitable y value to place them where you want them on the chart), then draw the mean+error bars as a third data series. [up to this point, I see no particular need for VBA].

    If the animation is essential, then you would add some VBA to continuously/periodically change the y and/or x values for the sample/resample data series and/or the mean+error bars data series to give the desired animation. Again, I am not sure what part you are baffled by. I believe you have the VBA skill to manipulate the values in a spreadsheet range and how to access Excel's functions in VBA (if/when needed).

    At this point, even if the animation is essential, I would focus on getting the static, non-animated version working (I would probably do this with all spreadsheet formulas, but it could be just as easily done using VBA). Once the non-animated version is working, then it should be relatively easy to add the animation.

  7. #7
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,192

    Re: Advice required...Excel's ability to create a user interactive simulation module...

    Am going to get some more info, put a demo together and I would like to revisit this post later in the week...
    Thanks again for your continued response...WATCH THIS SPACE...

  8. #8
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,192

    Re: Advice required...Excel's ability to create a user interactive simulation module...

    Hi Mrshorty

    Just an update...See attached sample file...A work in progress...
    User selects values...Once mean & std dev is selected that chart remains constant for comparison...
    User then plays around with sample size and number of samples...
    Just need to streamline the transition when the charts source data changes...
    Any suggestions would be appreciated...
    Attached Files Attached Files
    Last edited by sintek; 11-06-2018 at 03:15 PM.

  9. #9
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,192

    Re: Advice required...Excel's ability to create a user interactive simulation module...

    I understand that when the chart's source data is populated via a range that is controlled by formulas, the transition when data changes is seamless...I have come to realize that the chart construct itself will remain constant...the data will always change though...larger or smaller...How can I get the chart to visually become smoother when my code creates new source data...
    I have kept the chart construct and am trying to make the change by setting the new source data after it is created??/
    Please Login or Register  to view this content.

  10. #10
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,819

    Re: Advice required...Excel's ability to create a user interactive simulation module...

    It is difficult for me to test, because you are using newer functions (NORM.INV()), for example) that are not available to my older version of Excel.

    I have kept the chart construct and am trying to make the change by setting the new source data after it is created??/
    The standard non-VBA solution to this kind of question is to define dynamic named ranges in the spreadsheet, then have the chart use those dynamic named ranges as the different series definitions. You seem to prefer to do things in VBA, where I tend to prefer spreadsheet solutions, but is there some reason you are avoiding defining dynamic named ranges for the charts? I guess the advantage I see to this approach would be that your VBA code does not need to define the chart source data after the fact. It just needs to enter the data into the spreadsheet, then the spreadsheet will figure out what the chart's source data ranges should be.

  11. #11
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,192

    Re: Advice required...Excel's ability to create a user interactive simulation module...

    Not to worry... I think I have perfected the Gist of the initial requirement...10 more to go...
    Thank you for your ongoing interest and feedback

    For those who have been following...hereby an updated trial version...
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 1
    Last Post: 02-12-2016, 08:59 AM
  2. Excel: how to create an interactive popup form
    By illo in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-02-2013, 11:34 AM
  3. Replies: 1
    Last Post: 06-04-2012, 05:25 PM
  4. Excel bank statement to Sage Automation - Advice required!
    By dantray in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-18-2012, 10:22 AM
  5. Disabling a user's ability to create a new worksheet?
    By jonvanwyk in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-23-2011, 12:56 AM
  6. Excel userform on a website - Advice required
    By PRodgers in forum Excel General
    Replies: 1
    Last Post: 08-07-2009, 09:54 AM
  7. [SOLVED] [SOLVED] how to create interactive US map in excel 2003
    By Desparate in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 07-10-2005, 04:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1