Hello, Is it possible to generate simulated data that look like the attached figure? The curve in the figure can be obtained from this equation respecting some conditions: if(Temperature > T_min & Temperature < T_max){ a*( Temperature -T_min)*( Temperature -T_max) } else 0 T_min ~ Uniform(0, 24) T_max ~ Uniform(25, 45) -a ~ Gamma(1, 1) Temperature <- seq(0, 45, by = 1) Thank you very much for your help. Have a nice day Marine -------------- next part -------------- A non-text attachment was scrubbed... Name: Untitled.png Type: image/png Size: 8165 bytes Desc: Untitled.png URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20170706/7c40973b/attachment.png>

Jeff Newmiller

2017-Jul-06 15:52 UTC

### [R] Generate simulated data respecting some conditions

Yes, definitely. However, this is so close to being legal R code that I feel you have not made any effort to translate it yourself, and this is the "R-help" mailing list, not the "R-do-my-work-for-me" mailing list. Is this homework? Have you read the "Introduction to R" document that is supplied with R? There are also many basic tutorials on the Internet and books available that would discuss the need to write R statements in an appropriate order so later statements can use objects created by earlier statements. -- Sent from my phone. Please excuse my brevity. On July 6, 2017 8:14:19 AM PDT, Marine Regis <marine.regis at hotmail.fr> wrote:>Hello, > >Is it possible to generate simulated data that look like the attached >figure? > >The curve in the figure can be obtained from this equation respecting >some conditions: > > > >if(Temperature > T_min & Temperature < T_max){ > > a*( Temperature -T_min)*( Temperature -T_max) > >} else 0 > > >T_min ~ Uniform(0, 24) > >T_max ~ Uniform(25, 45) > >-a ~ Gamma(1, 1) > >Temperature <- seq(0, 45, by = 1) > > > >Thank you very much for your help. > >Have a nice day > >Marine