Rank: 158 based on 1257 downloads (last 30 days) and 8 files submitted
photo

Dahua Lin

E-mail
Company/University
MIT

Personal Profile:

Professional Interests:
Statistical Learning, Computer Vision

 

Watch this Author's files

 

Files Posted by Dahua View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
08 Nov 2008 Safe computation of logarithm-determinat of large matrix Computes the logarithm of determinant of a matrix in a safe way that avoids overflow/underflow. Author: Dahua Lin gaussian, matrix, determinant, logdet, logarithm 150 0
28 Oct 2008 Sampling from a discrete distribution The function is to draw samples from an arbitrary discrete distribution. Author: Dahua Lin monte carlo, discrete distribution, simulation, sampling 161 4
  • 5.0
5.0 | 1 rating
10 Oct 2008 String Toolkits A set of useful string manipulation functions that MATLAB does not offer Author: Dahua Lin string manipulation, split, string processing, strings, string, join string 132 2
10 Oct 2008 UUID Generation For generating UUID in MATLAB Author: Dahua Lin unique identifier, universal, miscellaneous, utilities, uuid 111 1
26 Aug 2008 Screenshot Minesweeper Game A minesweeper game similar to the one in Windows, but implemented in pure MATLAB Author: Dahua Lin mine, sweeper, minesweeper, games, game 191 2
Comments and Ratings by Dahua View all
Updated File Comments Rating
29 Oct 2008 Sampling from a discrete distribution The function is to draw samples from an arbitrary discrete distribution. Author: Dahua Lin

Jos,

I have checked with randp. Though they seem offering similar functionalities, however, the efficiency is drastically different, especially in very large scale monte carlo simulation, say you need to draw thousands or millions of samples from a distribution over thousands or even millions of states, which is not unusual in real engineering applications.

With randp, it would be incur obvious latency when you want to draw thousands of samples from thousands of states, or even run out of memory (thus resulting an empty matrix), as the algorithm implemented by randp is of complexity O(k n), where k is the number of states in the sample space. However, even million-state-level sampling can be accomplished by this function within milliseconds, as its complexity is only O(n logk).

Hope my explanation can clarify the differences between these two files.

28 Oct 2008 Sampling from a discrete distribution The function is to draw samples from an arbitrary discrete distribution. Author: Dahua Lin

There's a bug in the initial submission, which has been fixed, and the new version has been uploaded, which may come out in a day.

Comments and Ratings on Dahua's Files View all
Updated File Comment by Comments Rating
21 Nov 2009 Statistical Learning Toolbox Functions for statistical learning, pattern recognition and computer vision, covering many topics. Author: Dahua Lin Cheng, Raymond

Thanks for your sharing, nice tutorial.

05 Nov 2009 Sampling from a discrete distribution The function is to draw samples from an arbitrary discrete distribution. Author: Dahua Lin Chen, Michael

your function seems to complicate the problem a little bit.
The following line is enough to do the jod
[~,x] = histc(rand(1,n),[0;cumsum(p(:))/sum(p)]);

18 Jul 2009 Computing Pairwise Distances and Metrics Compute pairwise distance or metric values between two sets of vectors Author: Dahua Lin Bharti, Amandeep

21 Jun 2009 Sampling from a discrete distribution The function is to draw samples from an arbitrary discrete distribution. Author: Dahua Lin Baiz, Carlos

25 May 2009 Statistical Learning Toolbox Functions for statistical learning, pattern recognition and computer vision, covering many topics. Author: Dahua Lin Patricia

Hi. I can't make it compile, could someone please send me the mex compiled file?
patri130@hotmail.com

Top Tags Applied by Dahua
classification, determinant, discrete distribution, distance, game
Files Tagged by Dahua View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
08 Nov 2008 Safe computation of logarithm-determinat of large matrix Computes the logarithm of determinant of a matrix in a safe way that avoids overflow/underflow. Author: Dahua Lin gaussian, matrix, determinant, logdet, logarithm 150 0
28 Oct 2008 Sampling from a discrete distribution The function is to draw samples from an arbitrary discrete distribution. Author: Dahua Lin monte carlo, discrete distribution, simulation, sampling 161 4
  • 5.0
5.0 | 1 rating
10 Oct 2008 String Toolkits A set of useful string manipulation functions that MATLAB does not offer Author: Dahua Lin string manipulation, split, string processing, strings, string, join string 132 2
10 Oct 2008 UUID Generation For generating UUID in MATLAB Author: Dahua Lin unique identifier, universal, miscellaneous, utilities, uuid 111 1
26 Aug 2008 Screenshot Minesweeper Game A minesweeper game similar to the one in Windows, but implemented in pure MATLAB Author: Dahua Lin mine, sweeper, minesweeper, games, game 191 2
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com