How to generate data from Kernel Distribution fit ?
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Haroon Zafar
il 23 Ago 2023
Risposto: VINAYAK LUHA
il 5 Set 2023
I have fitted some data to through kernel distribution using the distribution fitting app. But I could not figure out hoe to generate data points using this distribution. Distribution kdfit is exported to workspace as can be seen in the figure below. How can i use this distribution to genrate say 20 datapoints that follow this distribution. ( PS: this distribution is generated from 50000 datapoints)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1463132/image.png)
Data file is also attached if you could please suggest a better way to fit this data. This is the EV charging start time during a day ( in minutes).
0 Commenti
Risposta accettata
VINAYAK LUHA
il 5 Set 2023
Hi Haroon,
To the best of my understanding, you wish to generate sample datapoints that follows the kernel distribution fit of your data.
Refer to step 5 in the following documentation on how to generate random numbers from a fitted kernel distribution https://in.mathworks.com/help/stats/fit-a-kernel-distribution-object-to-data.html
For improving the fit, you can adjust the bandwidth or kernel type parameters and settle for some quality as per the following documentation.https://in.mathworks.com/help/stats/kernel-distribution.html
Hope this helps.
0 Commenti
Più risposte (0)
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!