<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Automating Degradation analysis in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Automating-Degradation-analysis/m-p/405781#M65588</link>
    <description>&lt;P&gt;Thank you, this worked perfectly&lt;/P&gt;</description>
    <pubDate>Fri, 30 Jul 2021 07:35:03 GMT</pubDate>
    <dc:creator>Jemster</dc:creator>
    <dc:date>2021-07-30T07:35:03Z</dc:date>
    <item>
      <title>Automating Degradation analysis</title>
      <link>https://community.jmp.com/t5/Discussions/Automating-Degradation-analysis/m-p/405278#M65557</link>
      <description>&lt;P&gt;I am trying to automate my degradation script so that I can use the same script to fit a degradation model to different data.&lt;/P&gt;&lt;P&gt;I currently have managed to fit the model I want to my data using Fit Model and have got the parameters as a column matrix.&lt;/P&gt;&lt;P&gt;I then tried to Input the matrix into the Initial Values for the Degredation Model but it just outputs the model with all the parameters unchanged. Is there any way I can input a matrix as parameter values, Initial values in the script below, into the degredation script.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Degradation(
	Y( :"Output/mV"n ),
	Time( :Time in hours ),
	Label( :Unit ID ),
	Application( Repeated Measures Degradation ),
	Connect Data Markers( 1 ),
	Show Fitted Lines( 1 ),
	Show Spec Limits( 1 ),
	Show Median Curves( 0 ),
	Show Legend( 0 ),
	No Tab List( 0 ),
	Set Upper Spec Limit( . ),
	Set Lower Spec Limit( . ),
	Set Censoring Time( . ),
	Show Residual Plot( 1 ),
	Show Inverse Prediction Plot( 1 ),
	Inverse Prediction Interval( No Interval ),
	Inverse Prediction Alpha( 0.05 ),
	Path Specifications(
		Nonlinear Path(
			Add Formula(
				Formula Name( "Model" ),
				Formula(
					Parameter(
						{a = 200, b = -0.00007},
						a[Unit ID] * Exp( b[Unit ID] * Time in hours )
					),
				),&lt;BR /&gt;//Trying to enter my matrix of parameters into the model
				Initial Values(A_para),
				Fitting Method( QuasiNewton BFGS ),
			),
			Select Formula( "Model" )
		),
		Run Model( "Model" )
	),
	Nonlinear Path( 1 ),
	Mean Path( 1 ),
	SendToReport(
		Dispatch(
			{"Overlay", "Output/mV Residuals by Time in hours"},
			"7",
			ScaleBox,
			{Min( -80 ), Max( 210 ), Inc( 50 ), Minor Ticks( 4 )}
		),
		Dispatch(
			{"Overlay", "Output/mV Residuals by Time in hours"},
			"13",
			ScaleBox,
			{Min( -80 ), Max( 210 ), Inc( 50 ), Minor Ticks( 4 )}
		),
		Dispatch(
			{"Overlay", "Model Specification"},
			"Empty",
			TextEditBox,
			{Fixed Size( 1, 100, 19 ), Set Text( "Model" )}
		),
	)
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;obj = Fit Curve(
			Y( :"Output/mV"n ),
			X( :Time in hours ),
			Group( :Unit ID ),
			);
			
//Currently this is using a slighlty different fitting method to the one used by the degredation platform

obj &amp;lt;&amp;lt; Fit Exponential 2P;

//Next I want to create the table of parameter estimates

dt_p = obj &amp;lt;&amp;lt; (Fit[1] &amp;lt;&amp;lt; Make Parameter Table);

//Now create a single column matrix of the parameter estimates

col_scale = Column( dt_p, "Scale" );
col_growth = Column( dt_p, "Growth Rate" );
A_scale = col_scale &amp;lt;&amp;lt; Get As Matrix;
A_growth = col_growth &amp;lt;&amp;lt; Get As Matrix;
A_para = A_scale |/ A_growth;
//Put values into a column to check I've done it right
dt_temp = Data Table( "Stacked and Transposed New Dates Raw Data" );
col_p = dt_temp &amp;lt;&amp;lt; New Column( "Parameters" );
col_p &amp;lt;&amp;lt; Set Values(A_para);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 19:53:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Automating-Degradation-analysis/m-p/405278#M65557</guid>
      <dc:creator>Jemster</dc:creator>
      <dc:date>2023-06-09T19:53:40Z</dc:date>
    </item>
    <item>
      <title>Re: Automating Degradation analysis</title>
      <link>https://community.jmp.com/t5/Discussions/Automating-Degradation-analysis/m-p/405633#M65565</link>
      <description>&lt;P&gt;At the moment, the degradation platform cannot take a named variable of a matrix like the way that you want.&lt;/P&gt;
&lt;P&gt;A workaround is to construct an expression, then evaluate.&lt;/P&gt;
&lt;P&gt;Suppose you already have an matrix&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;A_para = [....];&lt;/LI-CODE&gt;
&lt;P&gt;which holds initial values.&lt;/P&gt;
&lt;P&gt;The workaround is to construct an expression like the following&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;code = expr(Degradation(
				Initial Values(
					A_para
				),
				Fixed(
					....
				)
));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Now swap out the name A_para by the actual matrix, like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;substitute into(code, expr(A_para), A_para);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Finally, run the code by:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;eval(code);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you want to use the inputting initial values as is, I believe you need to assign an matrix of one's into the Fixed clause.&lt;/P&gt;
&lt;P&gt;Please let me know how it goes.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jul 2021 16:24:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Automating-Degradation-analysis/m-p/405633#M65565</guid>
      <dc:creator>peng_liu</dc:creator>
      <dc:date>2021-07-29T16:24:34Z</dc:date>
    </item>
    <item>
      <title>Re: Automating Degradation analysis</title>
      <link>https://community.jmp.com/t5/Discussions/Automating-Degradation-analysis/m-p/405781#M65588</link>
      <description>&lt;P&gt;Thank you, this worked perfectly&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jul 2021 07:35:03 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Automating-Degradation-analysis/m-p/405781#M65588</guid>
      <dc:creator>Jemster</dc:creator>
      <dc:date>2021-07-30T07:35:03Z</dc:date>
    </item>
  </channel>
</rss>

