MaheshJoshi Tracker
https://communities.sas.com/kntur85557/tracker
MaheshJoshi TrackerSun, 19 May 2024 20:10:55 GMT2024-05-19T20:10:55ZSAS® Visual Forecasting Open Source Modeling Node
https://communities.sas.com/t5/SAS-Explore-Presentations/SAS-Visual-Forecasting-Open-Source-Modeling-Node/ta-p/896792
<P>SAS' <a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/44052">@MaheshJoshi</a> and three co-presenters showcase new support for running Python and R in an open-source modeling node.</P>Mon, 02 Oct 2023 20:02:25 GMThttps://communities.sas.com/t5/SAS-Explore-Presentations/SAS-Visual-Forecasting-Open-Source-Modeling-Node/ta-p/896792MaheshJoshi2023-10-02T20:02:25ZRe: glm model for severity
https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/glm-model-for-severity/m-p/311800#M2039
<P>Rick has addressed GENMOD's warning. I will comment on why PROC SEVERITY doesn't throw a similar warning. PROC SEVERITY supports multiple distributions including your own distributions, so it allows 0 values for the "loss" (response) variable. It takes care of the 0 values in the distribution definition functions. In particular, for the gamma distribution, it uses the following defintion of the PDF function (you can see other functions of PROC SEVERITY's predefined gamma distribution <A href="http://support.sas.com/documentation/onlinedoc/ets/ex_code/141/svrtgamm.html" target="_blank">here</A> and all model definitions <A href="http://support.sas.com/documentation/onlinedoc/ets/ex_code/141/index.html#SEVERITY" target="_blank">here</A><span class="lia-unicode-emoji" title=":disappointed_face:">😞</span></P>
<PRE> function GAMMA_PDF(x, Theta, Alpha);
/* Theta : Scale */
/* Alpha : Shape */
minVal = 2.220446E-16; /* alternatives:
MACEPS = 2.220446E-16
sqrt(SMALL)= 0.1491668147e-153 */
if (x < minVal) then do;
x1 = minVal;
/* assume exp(-x1/Theta)~1, because x1/Theta is too small */
p = x1**(Alpha-1) / (gamma(Alpha) * (Theta**Alpha));
end;
else
p = pdf("GAMMA", x, Alpha, Theta);
return(p);
endsub;</PRE>
<P>If you do not want this definition, you can always define your own version of gamma distribution that returns missing PDF and CDF values for 0-valued losses and try fitting it. See PROC SEVERITY documentation to find out how to define and fit your own distributions.</P>
<P> </P>
<P>Now, coming back to your question, with your data that contains 0-valued losses, you will probably get some estimates from PROC SEVERITY because its standard gamma definition treats 0 values as very small values (=constant('MACEPS')), but you will need to look at the parameter estimates, fit statistics, and plots to see if it is indeed a good fit. In general, if you have lot of 0-valued response values, you should use a different distribution. The zero-inflated models mentioned by Rick are one option, but I would also suggest looking at the Tweedie distribution.</P>
<P> </P>
<P>Hope this helps,</P>
<P>Mahesh</P>Tue, 15 Nov 2016 18:01:36 GMThttps://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/glm-model-for-severity/m-p/311800#M2039MaheshJoshi2016-11-15T18:01:36ZRe: Forecasting using probability distribution
https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Forecasting-using-probability-distribution/m-p/308291#M2002
<P>Which version of SAS/ETS do you have? The OUTSCORELIB statement was first added as an experimental feature to the SAS/ETS 13.1 version, which shipped with SAS Foundation release 9.4M1. It became a production feature in SAS/ETS 13.2. If you have a version earlier than the 13.1 version, I would recommend ugrading to SAS/ETS 13.2 or ideally to SAS/ETS 14.1. Thanks!</P>Mon, 31 Oct 2016 14:58:34 GMThttps://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Forecasting-using-probability-distribution/m-p/308291#M2002MaheshJoshi2016-10-31T14:58:34ZRe: Forecasting using probability distribution
https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Forecasting-using-probability-distribution/m-p/308025#M2000
<P>PROC SEVERITY supports OUTSCORELIB statement that enables you to create what are called "scoring functions" that you can evaluate on any data set with a fitted distribution. Please read the SAS/ETS User's Guide to know more about the OUTSCORELIB statement and post back if you have any questions.</P>
<P> </P>
<P>In the context of PROC SEVERITY, 'scoring' means you can compute quantities such as CDF, PDF, etc of the the fitted distribution for a given response variable value, or mean of the distribution if it is defined and if <dist>_MEAN function appears in the libraries specified in the CMPLIB path (SASHELP.SVRTDIST contains mean functions for all predefined distributions). In the "extensibility" spirit of PROC SEVERITY, you can also define your own scoring functions.</P>
<P> </P>
<P>Starting with SAS/ETS 14.2 release, which ships later this year, you will also be able to use the OUTPUT statement to "score" observations in the input (DATA=) data set. The OUTPUT statement allows you to overcome one limitation of scoring functions, which is that the scoring functions cannot be generated when your severity model contains complex scale regression effects such as CLASS variables and interactions.</P>Fri, 28 Oct 2016 21:02:08 GMThttps://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Forecasting-using-probability-distribution/m-p/308025#M2000MaheshJoshi2016-10-28T21:02:08ZRe: proc hpcdm
https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/proc-hpcdm/m-p/306366#M1988
<P>For a frequency distribution to be accepted through the COUNTSTORE= option of PROC HPCDM, you need to estimate it with PROC COUNTREG. Unfortunately, PROC COUNTREG does not support binomial distribution. However, it does support the <STRONG>negative</STRONG> binomial distribution, which is more commonly used to model count data than the binomial distribution. If you cannot use the negative binomial distribution, then you will need to use the external counts feature of PROC HPCDM. Steps to take:</P>
<UL>
<LI>Estimate the binomial distribution by using something other than PROC COUNTREG.</LI>
<LI>Simulate a sample data set of counts by using your estimated binomial distribution. You can use DATA step to do this. Say this data set is called WORK.FOO and stores the generated count in a variable called COUNT.</LI>
<LI>Invoke PROC HPCDM with DATA=WORK.FOO along with other options as needed and specify "EXTERNALCOUNTS COUNT=COUNT;" statement to tell PROC HPCDM which variable contains the simulated counts.</LI>
</UL>
<P> </P>
<P>I do not understand your question about "use a constant. Can you please elaborate? Do you want to simulate with a constant value of loss count? In that case, you can create a data set that contains one row and one column with column value being the constant value of the count you want to use, and then use the steps that are listed above to simulate with that constant count. If you want the sample size to be a multiple of the constant count, specifying the multiplier as the NREPLICATES= option.</P>
<P> </P>
<P>Hope this answers your questions.</P>Fri, 21 Oct 2016 16:57:19 GMThttps://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/proc-hpcdm/m-p/306366#M1988MaheshJoshi2016-10-21T16:57:19ZRe: Proc severity that results only with Kernel
https://communities.sas.com/t5/Statistical-Procedures/Proc-severity-that-results-only-with-Kernel/m-p/212084#M11453
<HTML><HEAD></HEAD><BODY><P>Please remove the '=' sign after 'dist' and try again.</P></BODY></HTML>Sat, 09 May 2015 16:55:17 GMThttps://communities.sas.com/t5/Statistical-Procedures/Proc-severity-that-results-only-with-Kernel/m-p/212084#M11453MaheshJoshi2015-05-09T16:55:17Z