Download The OPTLSO Procedure
Transcript
20 F Chapter 3: The OPTLSO Procedure sums the results for you. This mode is particularly useful when the data set is large and possibly distributed over a set of nodes, as shown in “Example 3.7: Using External Data Sets” on page 59. The following statements demonstrate how to store the necessary observations in an external data set for use with PROC FCMP: data logdata; input x @@; datalines; 1 3 4 5 7 ; data lkhobj2; input _id_ $ _function_ $ _sense_ $ _dataset_ $; datalines; f loglkh2 max logdata ; proc fcmp outlib=sasuser.myfuncs.mypkg; function loglkh2(mu, sigma, x); return (-log(sigma) -0.5*((x-mu)/sigma)**2); endsub; run; proc optlso variables = lkhvar objective = lkhobj2; run; In this case, for each line of data in the data set logdata, the FCMP function LOGLKH2 is called. It is important that the non-variable arguments of LOGLKH2 coincide with a subset of the column names in logdata, in this case X. However, the order in which the variables and data column names appear is not important. The following definition would work as well: data lkhobj3; input _id_ $ _function_ $ _sense_ $ _dataset_ $; datalines; f loglkh3 max logdata ; proc fcmp outlib=sasuser.myfuncs.mypkg; function loglkh3(x, sigma, mu); return (- log(sigma) - 0.5*((x-mu)/sigma)**2); endsub; run; proc optlso variables = lkhvar objective = lkhobj3; run;