tag:blogger.com,1999:blog-37324607.post3877763860703483699..comments2019-12-30T07:18:40.343-05:00Comments on Data Mining in MATLAB: A Quick Introduction to Monte-Carlo and Quasi-Monte Carlo IntegrationWill Dwinnellhttp://www.blogger.com/profile/03379859054257561952noreply@blogger.comBlogger10125tag:blogger.com,1999:blog-37324607.post-49949756061667336622012-10-18T12:38:31.094-04:002012-10-18T12:38:31.094-04:00I think adding the MATLAB link for monte carlo si...I think adding the MATLAB link for <a href="http://www.mathworks.com/discovery/monte-carlo-simulation.html" rel="nofollow"> monte carlo simulation</a> would be appropriate here as well. There are many techniques one can learn in conjunction with this post.commissionerhttps://www.blogger.com/profile/05716488318575702609noreply@blogger.comtag:blogger.com,1999:blog-37324607.post-91686761889145983052008-04-03T18:29:00.000-04:002008-04-03T18:29:00.000-04:00ying ding,I do apologize for that. I believe the ...ying ding,<BR/><BR/>I do apologize for that. I believe the file links will be restored this weekend. In the meantime, please feel free to contact me (see <A HREF="http://www.blogger.com/profile/03379859054257561952" REL="nofollow">View my complete profile</A> on the main Web log page) with your e-mail address and I will e-mail the code to you.Will Dwinnellhttps://www.blogger.com/profile/03379859054257561952noreply@blogger.comtag:blogger.com,1999:blog-37324607.post-88424077472677142022008-04-03T11:57:00.000-04:002008-04-03T11:57:00.000-04:00Hi, I like this blog very much. Can you repost you...Hi, I like this blog very much. Can you repost your sampleerror function on the blog, since it seems it can not be downloaded. Thanks.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-37324607.post-79439717771396803622008-03-28T22:37:00.000-04:002008-03-28T22:37:00.000-04:00Will, thanks again... you've been a great help...Will, thanks again... you've been a great help...Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-37324607.post-3365499694961093632008-03-28T19:12:00.000-04:002008-03-28T19:12:00.000-04:00As you say, this is a regression (or "curve-fittin...As you say, this is a regression (or "curve-fitting") problem, for which MATLAB provides a variety of solutions. Which is best will depend on your particular problem.<BR/><BR/>The backslash operator, <I>polyfit</I>, <I>interp1</I> and <I>pchip</I> in base MATLAB are a good place to start, and can be fairly flexible with a little imagination (such through the use of nonlinear transformations). The Statistics Toolbox and Curve Fitting Toolbox (among others) also provide yet more tools, and of course there is a wealth of code available on-line for free. See my Nov-14-2006 posting, <A HREF="http://matlabdatamining.blogspot.com/2006/11/finding-matlab-source-code-and-tools.html" REL="nofollow">Finding MATLAB Source Code And Tools</A> for ideas about where and how to search.<BR/><BR/>One other possibility is my own <I>GASplineFit</I> routine, which I described in my post <A HREF="http://matlabdatamining.blogspot.com/2007/01/gasplinefit-flexible-curve-fitting.html" REL="nofollow"><I>GASplineFit</I>: A Flexible Curve Fitting Routine</A> (Jan-19-2007).Will Dwinnellhttps://www.blogger.com/profile/03379859054257561952noreply@blogger.comtag:blogger.com,1999:blog-37324607.post-41997484167574693972008-03-28T14:23:00.000-04:002008-03-28T14:23:00.000-04:00Thanks Will.. You have a lot of useful stuff here....Thanks Will.. You have a lot of useful stuff here.<BR/><BR/>I'm moving from SAS to Matlab so your data management articles are very useful too, still I find that it is difficult to import data (large datasets) into Matlab. <BR/><BR/>Is there a convenient way to convert a small dataset into an equation (for instance the data associated with the ROC). I know this is a regression problem (i.e. i can simply fit some equation) but I'm wondering if there is a different if not better way to do it.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-37324607.post-20219180671654344992008-03-28T04:20:00.000-04:002008-03-28T04:20:00.000-04:00Thanks for your comments, Swami.You are correct th...Thanks for your comments, Swami.<BR/><BR/>You are correct that Monte Carlo integration could be used to estimate the area of quite complex regions- even ones which are only known by calls to complex functions. In fact, this is one of the most important applications of such methods in practice, for example for financial calculations.<BR/><BR/>I would suggest, though, that calculation of the AUC ("area under the [ROC] curve") is probably more efficiently handled by code written specifcally for that purpose, such as my <I>SampleError</I> function, which I described in my Jun-20-2007 post, <A HREF="http://matlabdatamining.blogspot.com/2007/06/roc-curves-and-auc.html" REL="nofollow">ROC Curves and AUC</A> and in my Jul-14-2007 post, <A HREF="http://matlabdatamining.blogspot.com/2007/07/calculating-auc-using-sampleerror.html" REL="nofollow">Calculating AUC Using SampleError()</A>.<BR/><BR/>There are a variety of pseudorandom number generators, but I haven't bother constructing my own, since the ones provided in the base MATLAB product (<I>rand</I> and <I>randn</I>) are of such high quality. I go over a few details of their use in my Dec-07-2006 post, <A HREF="http://matlabdatamining.blogspot.com/2006/12/quick-tip-regarding-rand-and-randn.html" REL="nofollow">Quick Tip Regarding <I>rand </I>and <I>randn</I></A>, and in my Jan-13-2007 post, <A HREF="http://matlabdatamining.blogspot.com/2007/01/revisiting-rand-matlab-2007a.html" REL="nofollow">Revisiting <I>rand</I> (MATLAB 2007a)</A>.Will Dwinnellhttps://www.blogger.com/profile/03379859054257561952noreply@blogger.comtag:blogger.com,1999:blog-37324607.post-85661417041811177192008-03-27T20:30:00.000-04:002008-03-27T20:30:00.000-04:00Thanks I like this blog (I like examples)!! To ext...Thanks I like this blog (I like examples)!! To extend your example, if I wanted to find out the intersection of 4 circles inside the square we basically see if it is inside all 4 circles independently? <BR/>Next we could replace the 4 circles with 4 crazy sets of equations. <BR/><BR/>Even when I don't know the actual equation, take for instance finding the area under an ROC curve I should be able to use this method!!<BR/><BR/>what are some of the good pseudo random generators and are there any guidelines for choosing one over the other.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-37324607.post-63987956972064958572008-03-25T03:30:00.000-04:002008-03-25T03:30:00.000-04:00Yes, you make a good point. Though the case I dem...Yes, you make a good point. Though the case I demonstrated was typical, there is no guarantee that things will always work out this way.Will Dwinnellhttps://www.blogger.com/profile/03379859054257561952noreply@blogger.comtag:blogger.com,1999:blog-37324607.post-27422849022161591082008-03-24T23:14:00.000-04:002008-03-24T23:14:00.000-04:00A very good illustration to start lectures on MC. ...A very good illustration to start lectures on MC. However, as with any Monte Carlo method, you might want to run the experiment several times and report mean results. For instance, I wrote a similar code in R using the Mersenne-Twister generator and got the answer 0.78537 on first attempt! It will be a good idea to just find the variance of the estimate or provide a chernoff bound.Delip Raohttps://www.blogger.com/profile/17504663683160693696noreply@blogger.com