Group Abstract Group Abstract

Message Boards Message Boards

0
|
1.8K Views
|
1 Reply
|
1 Total Like
View groups...
Share
Share this post:

Simulate data such that specific condition is met in polynomial regression

Posted 3 years ago

Hello, I want to create a dataset (e.g., N = 20) based on the following polynomial regression: enter image description here

The only condition that should be met is y= 0 for x = 1, 3, or 7. I don't care about the epsilons for the moment, but I would be very happy to find a solution on how to generate the corresponding x values. Thank you!

POSTED BY: Anabel Buechner

How about this:

Table[RandomChoice[{x - 1, x - 3, 
     x - 7}] (RandomInteger[{-3, 3}] x^2 + RandomInteger[{-3, 3}] x + 
     RandomInteger[{-3, 3}]) // Expand, {20}]
POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard