Jump to content


Photo

Advanced options for user-defined model


  • Please log in to reply
6 replies to this topic

#1 Jun Shen

Jun Shen

    Member

  • Members
  • PipPip
  • 23 posts

Posted 11 October 2010 - 04:24 AM

I have a few questions about user-defined models

 

1. What is the exact executing sequence of all the code blocks (e.g. Temporary, Start, Transform, Function etc)?

2. Are the WinNonlin variables (e.g. F, WT, X, Y) are global variables that are accessible in any code block? I used "WT" as a variable symbol to store body weight data in "Diff" block and it doesn't seem to affect the weighting scheme.

3. To follow up question two, in the User's guide, p244

 

MODEL 1

TRANSFORM

IF X > 10 THEN

WT = 1/Y

ELSE

WT = 1/(Y*Y)

ENDIF

END

 

My question is if I can use "F" instead of Y to specify a re-weighting scheme in Transform block. Or alternatively can I use the "IF THEN" structure in Function block to specify different weighting schemes. This question also goes back to question 2, is F a global variable?

 

4. I understand the "Diff" block runs to the last X variable. I want to code it in a way that the "Diff" system can run to an extended arbitrary time point which is determined dynamically in the estimation process. I see a clumsy way to do it is to insert a dummy time point in the data set. But I want it in a more flexible way. I noticed in the User's guide there is an XARRAY variable. How do I access to that?

 

So much for the first time. Appreciate your commets.

 

Jun Shen

Senior Pharmacokineticist

Seventh Wave Labs



#2 Ana Henry

Ana Henry

    Advanced Member

  • Val_Members
  • PipPipPip
  • 232 posts

Posted 19 October 2010 - 09:12 PM

Dear Jun Shen
Here are some answers to your questions
1. What is the exact executing sequence of all the code blocks (e.g. Temporary, Start, Transform, Function etc)?
Answer: The sequence for blocks is temp/transform/start (if there are Des/diff (if there are Des)/Function 1, 2, …/ seco

2. Are the WinNonlin variables (e.g. F, WT, X, Y) are global variables that are accessible in any code block? I used "WT" as a variable symbol to store body weight data in "Diff" block and it doesn't seem to affect the weighting scheme.

Answer: only variables in the temp block are global – all others are local to that block

3. To follow up question two, in the User's guide, p244

MODEL 1
TRANSFORM
IF X > 10 THEN
WT = 1/Y
ELSE
WT = 1/(Y*Y)
ENDIF
END

My question is if I can use "F" instead of Y to specify a re-weighting scheme in Transform block. Or alternatively can I use the "IF THEN" structure in Function block to specify different weighting schemes. This question also goes back to question 2, is F a global variable?

: the issue is whether one wants static (fixed) weights or to to iterative reweighting. For static/fixed weights, the above will work or could define these in the function block. If doing iterative reweighting, suggest you replace y with F inside the function block but after f is defined. For example
Func 1
F = some function
wt = 1/(f*f)
end


4. I understand the "Diff" block runs to the last X variable. I want to code it in a way that the "Diff" system can run to an extended arbitrary time point which is determined dynamically in the estimation process. I see a clumsy way to do it is to insert a dummy time point in the data set. But I want it in a more flexible way. I noticed in the User's guide there is an XARRAY variable. How do I access to that?

there is no way to dynamically define a sampling time – sorry.


Hope this helps,
Ana

#3 Jun Shen

Jun Shen

    Member

  • Members
  • PipPip
  • 23 posts

Posted 19 October 2010 - 09:24 PM

Ana,

 

Thanks for the answers.

 

For question #3 I intended to use different weighting schemes for different part of the data. For example, for Y>Value A, 1/F be used, for Y

 

Jun



#4 Jun Shen

Jun Shen

    Member

  • Members
  • PipPip
  • 23 posts

Posted 19 October 2010 - 09:29 PM

Ana,

 

Also for question #2 I had different experience.

 

I defined a bunch of variables in "Diff" block and used them to calculate some secondary parameters in "SECO" block. Since all the values of these variables are still available in "SECO", they kind of become "global". Any comment? Thanks.

 

Jun



#5 Ana Henry

Ana Henry

    Advanced Member

  • Val_Members
  • PipPipPip
  • 232 posts

Posted 21 October 2010 - 08:43 PM

Dear Jun,

 

You should be able to use different weighting schemes for different part of the data. Below is an example:

 

FUNC1

IF (T LE TLAG) THEN

F=0.0

WT=0.0

ELSE

F = .......

ENDIF

END

 

The only global variables that can be used throughout the code need to be defined in the TEMP block.In some cases then secondary block might be able to access some of the parameters defined but these would not be available in the rest of the code.

 

Ana



#6 Jun Shen

Jun Shen

    Member

  • Members
  • PipPip
  • 23 posts

Posted 21 October 2010 - 09:10 PM

Dear Ana,

 

Thanks again. So to what other blocks does "SECO" have access, in addition to "DIFF"?

 

Jun



#7 Ana Henry

Ana Henry

    Advanced Member

  • Val_Members
  • PipPipPip
  • 232 posts

Posted 26 October 2010 - 06:01 PM

Seco has access to TEMP ( as global variables), DIFF and FUNC






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users