MATLAB: I have weibull parameters k = 2 and c = 10 m/s for wind speed, how to generate the frequency distribution of wind speed by applying Monte Carlo simulation with sample size N = 8000
MATLABstatistics
Related Solutions
doc normcdfdoc normpdf
When you know what you want but not sure the name, try something like
>> lookfor normalrealmin - Smallest positive normalized floating point number.randn - Normally distributed pseudorandom numbers.sprandn - Sparse normally distributed random matrix.surfnorm - Surface normals.isonormals - Isosurface normals.cde - cd elliptic function with normalized complex argument.sne - sn elliptic function with normalized complex argument.addfreqcsmenu - Add a cs menu to switch between linear and normalized frequencyconvertfrequnits - converts between Normalized, Hz, kHz, etchistfit - Histogram with superimposed fitted normal density.jbtest - Jarque-Bera hypothesis test of composite normality.lhsnorm - Generate a latin hypercube sample with a normal distributionlogncdf - Lognormal cumulative distribution function (cdf).lognfit - Parameter estimates and confidence intervals for lognormal data.logninv - Inverse of the lognormal cumulative distribution function (cdf).lognlike - Negative log-likelihood for the lognormal distribution.lognpdf - Lognormal probability density function (pdf).lognrnd - Random arrays from the lognormal distribution.lognstat - Mean and variance for the lognormal distribution.mvncdf - Multivariate normal cumulative distribution function (cdf).mvnpdf - Multivariate normal probability density function (pdf).mvnrnd - Random vectors from the multivariate normal distribution.normcdf - Normal cumulative distribution function (cdf).normfit - Parameter estimates and confidence intervals for normal data.norminv - Inverse of the normal cumulative distribution function (cdf).normlike - Negative log-likelihood for the normal distribution.normpdf - Normal probability density function (pdf).normplot - Displays a normal probability plot.normrnd - Random arrays from the normal distribution.normspec - Plots normal density between specification limits.normstat - Mean and variance for the normal distribution.logn3fit - Fit a 3-param lognormal dist'n using cumulative probabilities.wgtnormfit - Fitting example for a weighted normal distribution.wgtnormfit2 - Fitting example for a weighted normal distribution (log(sigma) parameterization).>>
Judicious search terms help but seeing the list of things related to "normal" lets you find the two functions of interest (plus a lot more depending upon which toolboxes are available, maybe) that might be of use/interest...
x = rand(1000, 1000);tic;for k = 1:1e3 m = mean(x);endtoc;tic;for k = 1:1e3 m = sum(x, 1) / size(x, 1);endtoc;
I assume, but cannot test currently, that there is a measurable difference in the timing due to the overhead for calling the M-function mean() (at least until 2009a it was an M-file).
Of course there is no magic flag to reduce the overhead, otherwise TMW would not have disabled this. So inlining the code is the only way to avoid the overhead. The resulting code is faster for the price of a reduced readability.
[EDITED] Summary of my comments:
- When you call functions, you cannot avoid the overhead.
- When you inline the code instead, the overhead vanishes, but other difficulties arise.
- Tertium non datur.
Best Answer