monte carlo simulation

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

monte carlo simulation

Maguin, Eugene

I need some help with a monte carlo simulation for power analysis. Although I’ve used mplus for this before, this particular problem cannot be accommodated in mplus. But there also are some things I don’t understand and want to take this opportunity to learn something new. So, suppose a simulation of

 

Y = 15 + 3*x  + e.

Let x be normal distribution with mean = 2, variance = 4.

Let e be normal distribution with mean = 0, variance = 16.

 

Easy enough to write

Compute x = rv.normal(2,2).

Compute e = rv.normal(0,4).

Compute y = 15 + 3*x + e.

 

Does a monte carlo assume that both x and e have the stated means and variances and covariance=0 in each replication, or that the variables simply go to those values in the long run?

 

Let’s say it’s the former, how then does one use spss commands to transform x and e to have the desired characteristics? (I didn’t search but I think this has been discussed before and factor scores were suggested.) I’d like to know if matrix-end matrix commands can be “easily” used to attain the same result.

 

I also be interested in references for monte simulation mechanics, not applications, those abound, but the mechanics.

 

Thanks, Gene Maguin

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: monte carlo simulation

Jon Peck
Before discussing your question, I want to point out that the STATS POWER extension command handles simple power calculations.  Might or might not be helpful here.

As for simulation, this is an area that is full of tricks.  The simplest approach is that you would draw from the specified distributions for each replication, which means that the distribution would on average be as specified, but each sample would vary.  Forcing the distribution parameters to be exact in each sample may be helpful in reducing the simulation variance and hence increasing its efficiency, but this depends on what you are really trying to simulate.  I would recommend starting with the the simple approach.

You might find the Simulation procedure (Analyze > Simulation) useful.

Another resource that might be helpful is the makedata custom dialog box, which you can get at


It generates random data from any of a large number of probability distributions  with or without correlations between the variables.  Variable correlations can be approximate or exact, so you can have perfectly orthogonal variables if  you want.




On Fri, Sep 14, 2018 at 2:24 PM Maguin, Eugene <[hidden email]> wrote:

I need some help with a monte carlo simulation for power analysis. Although I’ve used mplus for this before, this particular problem cannot be accommodated in mplus. But there also are some things I don’t understand and want to take this opportunity to learn something new. So, suppose a simulation of

 

Y = 15 + 3*x  + e.

Let x be normal distribution with mean = 2, variance = 4.

Let e be normal distribution with mean = 0, variance = 16.

 

Easy enough to write

Compute x = rv.normal(2,2).

Compute e = rv.normal(0,4).

Compute y = 15 + 3*x + e.

 

Does a monte carlo assume that both x and e have the stated means and variances and covariance=0 in each replication, or that the variables simply go to those values in the long run?

 

Let’s say it’s the former, how then does one use spss commands to transform x and e to have the desired characteristics? (I didn’t search but I think this has been discussed before and factor scores were suggested.) I’d like to know if matrix-end matrix commands can be “easily” used to attain the same result.

 

I also be interested in references for monte simulation mechanics, not applications, those abound, but the mechanics.

 

Thanks, Gene Maguin

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD


--
Jon K Peck
[hidden email]

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: monte carlo simulation

Rich Ulrich

Jon says,

   "Forcing the distribution parameters to be exact in each sample may be helpful in reducing the

  simulation variance"


 - but, I think, it invalidates the assumption of the usual power analysis, namely, that you are

drawing /random samples/ from a population with known mean and variance. The means and variances which are achieved should also follow their expected distributions. 


  "and hence increasing its efficiency, but this depends on what you are really trying to simulate."


Are you sure?

- I can't dispute that can be weird cases, but, off hand, I don't think I've heard of a simulation done that way.

Maybe you would want to restrict the variability if you were doing eventual tests with Finite Population
Corrections, but that almost never arises in research applications.  - For Finite Populations, you most
naturally would start with your known, finite population and draw samples of the desired sizes.

If you want to know rank-order properties of an exact distribution, those are readily looked-up or
computed for the Normal.

--
Rich Ulrich

From: SPSSX(r) Discussion <[hidden email]> on behalf of Jon Peck <[hidden email]>
Sent: Friday, September 14, 2018 6:02:34 PM
To: [hidden email]
Subject: Re: monte carlo simulation
 
Before discussing your question, I want to point out that the STATS POWER extension command handles simple power calculations.  Might or might not be helpful here.

As for simulation, this is an area that is full of tricks.  The simplest approach is that you would draw from the specified distributions for each replication, which means that the distribution would on average be as specified, but each sample would vary.  Forcing the distribution parameters to be exact in each sample may be helpful in reducing the simulation variance and hence increasing its efficiency, but this depends on what you are really trying to simulate.  I would recommend starting with the the simple approach.

You might find the Simulation procedure (Analyze > Simulation) useful.

Another resource that might be helpful is the makedata custom dialog box, which you can get at


It generates random data from any of a large number of probability distributions  with or without correlations between the variables.  Variable correlations can be approximate or exact, so you can have perfectly orthogonal variables if  you want.




On Fri, Sep 14, 2018 at 2:24 PM Maguin, Eugene <[hidden email]> wrote:

I need some help with a monte carlo simulation for power analysis. Although I’ve used mplus for this before, this particular problem cannot be accommodated in mplus. But there also are some things I don’t understand and want to take this opportunity to learn something new. So, suppose a simulation of

 

Y = 15 + 3*x  + e.

Let x be normal distribution with mean = 2, variance = 4.

Let e be normal distribution with mean = 0, variance = 16.

 

Easy enough to write

Compute x = rv.normal(2,2).

Compute e = rv.normal(0,4).

Compute y = 15 + 3*x + e.

 

Does a monte carlo assume that both x and e have the stated means and variances and covariance=0 in each replication, or that the variables simply go to those values in the long run?

 

Let’s say it’s the former, how then does one use spss commands to transform x and e to have the desired characteristics? (I didn’t search but I think this has been discussed before and factor scores were suggested.) I’d like to know if matrix-end matrix commands can be “easily” used to attain the same result.

 

I also be interested in references for monte simulation mechanics, not applications, those abound, but the mechanics.

 

Thanks, Gene Maguin

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD


--
Jon K Peck
[hidden email]

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: monte carlo simulation

Jon Peck
I was thinking of situations where you can manipulate the data in ways that allow sharper estimation, but typically require adjusting the results.  The delightful classic Methuen monograph, Monte Carlo Methods, was an eye opener for me many,many moons ago.


But, as I said, start simple.

On Fri, Sep 14, 2018 at 7:45 PM Rich Ulrich <[hidden email]> wrote:

Jon says,

   "Forcing the distribution parameters to be exact in each sample may be helpful in reducing the

  simulation variance"


 - but, I think, it invalidates the assumption of the usual power analysis, namely, that you are

drawing /random samples/ from a population with known mean and variance. The means and variances which are achieved should also follow their expected distributions. 


  "and hence increasing its efficiency, but this depends on what you are really trying to simulate."


Are you sure?

- I can't dispute that can be weird cases, but, off hand, I don't think I've heard of a simulation done that way.

Maybe you would want to restrict the variability if you were doing eventual tests with Finite Population
Corrections, but that almost never arises in research applications.  - For Finite Populations, you most
naturally would start with your known, finite population and draw samples of the desired sizes.

If you want to know rank-order properties of an exact distribution, those are readily looked-up or
computed for the Normal.

--
Rich Ulrich

From: SPSSX(r) Discussion <[hidden email]> on behalf of Jon Peck <[hidden email]>
Sent: Friday, September 14, 2018 6:02:34 PM
To: [hidden email]
Subject: Re: monte carlo simulation
 
Before discussing your question, I want to point out that the STATS POWER extension command handles simple power calculations.  Might or might not be helpful here.

As for simulation, this is an area that is full of tricks.  The simplest approach is that you would draw from the specified distributions for each replication, which means that the distribution would on average be as specified, but each sample would vary.  Forcing the distribution parameters to be exact in each sample may be helpful in reducing the simulation variance and hence increasing its efficiency, but this depends on what you are really trying to simulate.  I would recommend starting with the the simple approach.

You might find the Simulation procedure (Analyze > Simulation) useful.

Another resource that might be helpful is the makedata custom dialog box, which you can get at


It generates random data from any of a large number of probability distributions  with or without correlations between the variables.  Variable correlations can be approximate or exact, so you can have perfectly orthogonal variables if  you want.




On Fri, Sep 14, 2018 at 2:24 PM Maguin, Eugene <[hidden email]> wrote:

I need some help with a monte carlo simulation for power analysis. Although I’ve used mplus for this before, this particular problem cannot be accommodated in mplus. But there also are some things I don’t understand and want to take this opportunity to learn something new. So, suppose a simulation of

 

Y = 15 + 3*x  + e.

Let x be normal distribution with mean = 2, variance = 4.

Let e be normal distribution with mean = 0, variance = 16.

 

Easy enough to write

Compute x = rv.normal(2,2).

Compute e = rv.normal(0,4).

Compute y = 15 + 3*x + e.

 

Does a monte carlo assume that both x and e have the stated means and variances and covariance=0 in each replication, or that the variables simply go to those values in the long run?

 

Let’s say it’s the former, how then does one use spss commands to transform x and e to have the desired characteristics? (I didn’t search but I think this has been discussed before and factor scores were suggested.) I’d like to know if matrix-end matrix commands can be “easily” used to attain the same result.

 

I also be interested in references for monte simulation mechanics, not applications, those abound, but the mechanics.

 

Thanks, Gene Maguin

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD


--
Jon K Peck
[hidden email]

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
--
Jon K Peck
[hidden email]

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD