tag:blogger.com,1999:blog-5967257812973754325.post8284366776785772333..comments2024-03-29T10:54:39.565+02:00Comments on Path: Gaussian Copula implementation revisitedMikeJuniperhill@gmail.comhttp://www.blogger.com/profile/17092818463104704509noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-5967257812973754325.post-60115515421423382502018-06-21T23:09:39.736+03:002018-06-21T23:09:39.736+03:00Hi Michael,
Would you mind sharing the example Exc...Hi Michael,<br />Would you mind sharing the example Excel spreadsheet with me (gkchang@gmail.com)?<br />Thanks so much,<br />George<br />gkchanghttps://www.blogger.com/profile/00608576884341305417noreply@blogger.comtag:blogger.com,1999:blog-5967257812973754325.post-33613710480967450372015-03-03T08:10:54.592+02:002015-03-03T08:10:54.592+02:00Glad to hear, that you have found this to be usefu...Glad to hear, that you have found this to be useful for your needs and thanks for the tip. Usually, for any "VBA production code", I am handling all external parameters (those nasty changing constants) like described in the following blog post:<br /><br />http://mikejuniperhill.blogspot.fi/2013/05/configuring-your-constants-from-global.htmlMikeJuniperhill@gmail.comhttps://www.blogger.com/profile/17092818463104704509noreply@blogger.comtag:blogger.com,1999:blog-5967257812973754325.post-2185914802003668652015-03-02T11:58:32.948+02:002015-03-02T11:58:32.948+02:00Hi Mikael,
This is just what I'm looking for ...Hi Mikael,<br /><br />This is just what I'm looking for so thanks. I'm going to extend some features as I need, but I just made one change that you might find useful.<br /><br />As I intend to move my final solution around across various file systems etc the "C:\temp' folder is a bit of a pain. You can make the program just look in the folder you have the workbook. I have shown the modified code below - you remove the path in the Declare statement and then you need to change the directory just once before any calls are made.<br /><br />Private Declare Function nextMT Lib "mt19937.dll" Alias "genrand" () As Double<br />'<br />Private Function IRandom_getNormalRandomMatrix( _<br /> ByVal nRows As Long, _<br /> ByVal nCols As Long) As Double()<br /> '<br /> ' retrieve NxM matrix with normal random numbers<br /> Dim r() As Double: ReDim r(1 To nRows, 1 To nCols)<br /> Dim i As Long, j As Long<br /> <br /> ChDir ActiveWorkbook.Path<br /> <br /> For i = 1 To nRows<br /> For j = 1 To nCols<br /> r(i, j) = InverseCumulativeNormal(nextMT())<br /> Next j<br /> Next i<br /> '<br /> IRandom_getNormalRandomMatrix = r<br />End FunctionMike Robertsnoreply@blogger.com