Giter VIP home page Giter VIP logo

rogerjdeangelis / utl_generating_a_non-normal_distribution_with_specified_skewness_and_kurtosis Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 5 KB

Generating a non-normal distribution with specified skewness and kurtosis. Keywords: sas sql join merge big data analytics macros oracle teradata mysql sas communities stackoverflow statistics artificial inteligence AI Python R Java Javascript WPS Matlab SPSS Scala Perl C C# Excel MS Access JSON graphics maps NLP natural language processing machine learning igraph DOSUBL DOW loop stackoverfl SAS community.

License: MIT License

SAS 100.00%

utl_generating_a_non-normal_distribution_with_specified_skewness_and_kurtosis's Introduction

utl_generating_a_non-normal_distribution_with_specified_skewness_and_kurtosis

Generating a non-normal distribution with specified skewness and kurtosis. Keywords: sas sql join merge big data analytics macros oracle teradata mysql sas communities stackoverflow statistics artificial inteligence AI Python R Java Javascript WPS Matlab SPSS Scala Perl C C# Excel MS Access JSON graphics maps NLP natural language processing machine learning igraph DOSUBL DOW loop stackoverfl SAS community. Generating a non-normal distribution with specified skewness and kurtosis

github
https://tinyurl.com/y9qa6slj
https://github.com/rogerjdeangelis/utl_generating_a_non-normal_distribution_with_specified_skewness_and_kurtosis

see
https://tinyurl.com/y7duvngv
https://www.rdocumentation.org/packages/SimMultiCorrData/versions/0.1.0/topics/nonnormvar1

Generate 10,000 observarions form a probability distribution with these cumulants(moments)

  MEAN       SD     SKEW KURTOSIS

     2        2        2        6

INPUT
=====

  MEAN       SD     SKEW KURTOSIS

     2        2        2        6

PROCESS  (WPS proc R working code)
===================================

   * this generates standard cululants(moments);

   stcums <- calc_theory(Dist = "Exponential", params = 0.5) # rate = 1/mean;

   * this creates a polynomial and generates 10,000 realizations od a random variable;

   H_exp <- nonnormvar1("Polynomial", means = 2, vars = 2, skews = stcums[3],
                       skurts = stcums[4], fifths = stcums[5],
                       sixths = stcums[6], n = 10000, seed = 1234);

OUTPUT
======


  Up to 40 obs from wantwps total obs=10,000

    Obs      WANT

      1    0.75398
      2    1.91082
      3    3.39320
    ...
   9998    0.71993
   9999    1.26072
  10000    1.12118

* It has the correct Skewness and Kurtosis

The UNIVARIATE Procedure

Variable:  WANT

                            Moments

N                       10000    Sum Weights              10000
Mean               1.99990541    Sum Observations    19999.0541
Std Deviation      1.41590728    Variance            2.00479344

Skewness           2.03412151    Kurtosis            6.18436338

Uncorrected SS     60042.1462    Corrected SS        20045.9296
Coeff Variation    70.7987125    Std Error Mean      0.01415907


*                _              _       _
 _ __ ___   __ _| | _____    __| | __ _| |_ __ _
| '_ ` _ \ / _` | |/ / _ \  / _` |/ _` | __/ _` |
| | | | | | (_| |   <  __/ | (_| | (_| | || (_| |
|_| |_| |_|\__,_|_|\_\___|  \__,_|\__,_|\__\__,_|

;

 stcums <- calc_theory(Dist = "Exponential", params = 0.5) # rate = 1/mean;

 *          _       _   _
 ___  ___ | |_   _| |_(_) ___  _ __
/ __|/ _ \| | | | | __| |/ _ \| '_ \
\__ \ (_) | | |_| | |_| | (_) | | | |
|___/\___/|_|\__,_|\__|_|\___/|_| |_|

;

%utl_submit_wps64('
libname sd1 "d:/sd1";
options set=R_HOME "C:/Program Files/R/R-3.3.2";
libname wrk "%sysfunc(pathname(work))";
libname hlp "C:\Program Files\SASHome\SASFoundation\9.4\core\sashelp";
proc r;
submit;
source("C:/Program Files/R/R-3.3.2/etc/Rprofile.site", echo=T);
library(SimMultiCorrData);
stcums <- calc_theory(Dist = "Exponential", params = 0.5) # rate = 1/mean;
stcums;
H_exp <- nonnormvar1("Polynomial", means = 2, vars = 2, skews = stcums[3],
                    skurts = stcums[4], fifths = stcums[5],
                    sixths = stcums[6], n = 10000, seed = 1234);
want<-H_exp$continuous_variable$V1;
endsubmit;
import r=want data=wrk.wantwps;
run;quit;
');

proc univariate data=wantwps;
var want;
run;quit;

utl_generating_a_non-normal_distribution_with_specified_skewness_and_kurtosis's People

Contributors

rogerjdeangelis avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.