BookmarkSubscribeRSS Feed
alicelili
Calcite | Level 5

I want to fit FMM with two three parameter Weibull, and set the position parameter to a fixed value theta = 5. There is a problem with the display code after input. Thank you for pointing out the error for me. Thank you!

proc fmm data=all plots=density;

model d = / dist=weibull( theta=5) link=log k=2;

run;

12 REPLIES 12
alicelili
Calcite | Level 5

Hello, I want to ask a question. . It is not known whether the SAS FMM program can match two three parameter Weibull distributions. If so, what code can I use? Thank you.

alicelili
Calcite | Level 5

On this basis, what code do I use to turn two parameters into three parameters? And I want to set the parameter a to the fixed value a = 5, and only ask for the values of B and C. what changes do I need to make in my code? thank you

Reeza
Super User
You haven't posted any code 😞
alicelili
Calcite | Level 5

proc fmm data=all plots=density;

model d = / dist=weibull( theta=5) link=log k=2; run;

I want to fit FMM with two three parameter Weibull, and set the position parameter to a fixed value theta = 5. There is a problem with the display code after inputing. Thank you for pointing out the error for me. Thank you

alicelili
Calcite | Level 5

I want to fit FMM with two three parameter Weibull, and set the position parameter to a fixed value theta = 5. There is a problem with the display code after input. Thank you for pointing out the error for me. Thank you!

proc fmm data=all plots=density;

model d = / dist=weibull( theta=5) link=log k=2;

run;

 

Reeza
Super User

What is the error in the log. Please don't post the same question multiple times as well - I've merged them into one for now.

Rick_SAS
SAS Super FREQ

Assuming that theta is the threshold parameter as fit by PROC UNIVARIATE, you can just subtract that value from your data and then fit the two-parameter model:

 

data W;
set All;
d = d - 5;  /* subtract the known value of the theta (threshold) parameter */
run;

proc fmm data=W plots=density;
model d = / dist=weibull link=log k=2;
run;
alicelili
Calcite | Level 5

I need to limit a parameter in Weibull to a fixed value, make theta = 5, and mixed FMM. As you said, subtraction can not achieve the purpose. My code is as follows. Where is the error code? I use the restrict code,thank you

data all;
input plot spcs $ D;
cards;
1 b 25.3
1 b 18

1 l 8.8
1 l 11.9
1 l 9.8

(Omit most data)

run;
proc fmm data=all plots=density;
model d = / dist=weibull link=log k=2 parms;
restrict theta=5 ;
run;

 

alicelili
Calcite | Level 5

alicelili_0-1633791842025.png

 
 

Intercept and scale in the picture correspond to Weibull double parameters, right? Intercept means shape parameters in Weibull function, and scale means shape parameters, right? Thank you

Rick_SAS
SAS Super FREQ

  >  As you said, subtraction can not achieve the purpose. 

I did not say that. I said that you SHOULD use subtraction if theta represents a threshold parameter and you are setting the threshold value.

 

Here is a link to the PROC FMM documentation that discusses the Weibull function. The doc explicitly states that FMM fits a two-parameter model. There is no theta parameter, so you cannot specify theta on the RESTRICT statement.

 

You can tell from the doc that the FMM procedure fits the multiplicative inverse of the SCALE parameter that UNIVARIATE fits. That is, if PROC UNIVARIATE estimates (Sigma, C), you can get similar estimates from PROC FMM. The relation is 

Sigma = exp(Intercept) 

C = 1/Scale

where Intercept and Scale are the parameter estimates from PROC FMM.

 

Here is an example program that uses simulated data and fits by using PROC UNIVARIATE and PROC FMM:

 

data All;
call streaminit(123);
theta=5;
component = 1;
do i = 1 to 2000;
   d = theta + rand("weibull", 1.5, 0.8);  /* C=Shape=1.5; Sigma=Scale=0.8 */
   output;
end;
component = 2;
do i = 1 to 1000;
   d = theta + rand("weibull", 4, 2);  /* C=Shape=4; Sigma=Scale=2 */
   output;
end;
run;

proc univariate data=All;
class component;
var d;
histogram d / weibull(theta=5);  /* fit (Sigma, C) for each component */
ods select ParameterEstimates;
run;

data W;
set All;
d = d - 5;  /* subtract the known value of the theta parameter */
run;

/* in parameter estimate table, 
    - the "Inverse Linked Estimate" = exp(Intercept) is the Sigma 
         param from UNIVARIATE
    - the Scale estimate is 1/C, where C is the parameter from UNIVARIATE
*/
proc fmm data=W plots=density;
   model d = / dist=weibull link=log k=2;
   ods select ParameterEstimates MixingProbs DensityPlot;
run;

Compare the results from UNIVARIATE and FMM. I believe this program answers all your questions.

alicelili
Calcite | Level 5
Thank you very much for your guidance!

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 12 replies
  • 2507 views
  • 4 likes
  • 3 in conversation