help for normal distribution

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

help for normal distribution

sohini dhar-2
hiii,
I want to know if i am making a normal distribution with the code
Normal a=RandomHelper.createNormal(8, 2);
how can i take a sample out of it....

any help will be great.

Regards,
Sohini

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest
Reply | Threaded
Open this post in threaded view
|

Re: help for normal distribution

Ozik, Jonathan
Sohini,

According to the Colt library API:
https://dst.lbl.gov/ACSSoftware/colt/api/cern/jet/random/Normal.html

nextDouble() should do the trick.

Jonathan

> On Jun 15, 2017, at 5:20 AM, sohini dhar <[hidden email]> wrote:
>
> hiii,
> I want to know if i am making a normal distribution with the code
> Normal a=RandomHelper.createNormal(8, 2);
> how can i take a sample out of it....
>
> any help will be great.
>
> Regards,
> Sohini
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot_______________________________________________
> Repast-interest mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/repast-interest


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest
Reply | Threaded
Open this post in threaded view
|

Re: help for normal distribution

sohini dhar-2
hi,
Thank u so much for the help. My job is done.
I wanted to ask something else. If I have two distributions can I concatenate them and select a number from the resulting distribution.

Sohini.

On Thu, Jun 15, 2017 at 8:48 PM, Ozik, Jonathan <[hidden email]> wrote:
Sohini,

According to the Colt library API:
https://dst.lbl.gov/ACSSoftware/colt/api/cern/jet/random/Normal.html

nextDouble() should do the trick.

Jonathan

> On Jun 15, 2017, at 5:20 AM, sohini dhar <[hidden email]> wrote:
>
> hiii,
> I want to know if i am making a normal distribution with the code
> Normal a=RandomHelper.createNormal(8, 2);
> how can i take a sample out of it....
>
> any help will be great.
>
> Regards,
> Sohini
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot_______________________________________________
> Repast-interest mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/repast-interest



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest
Reply | Threaded
Open this post in threaded view
|

Re: help for normal distribution

sohini dhar-2
also i want to know how can i plot a normal distribution in repast

On Sat, Jun 17, 2017 at 4:15 PM, sohini dhar <[hidden email]> wrote:
hi,
Thank u so much for the help. My job is done.
I wanted to ask something else. If I have two distributions can I concatenate them and select a number from the resulting distribution.

Sohini.

On Thu, Jun 15, 2017 at 8:48 PM, Ozik, Jonathan <[hidden email]> wrote:
Sohini,

According to the Colt library API:
https://dst.lbl.gov/ACSSoftware/colt/api/cern/jet/random/Normal.html

nextDouble() should do the trick.

Jonathan

> On Jun 15, 2017, at 5:20 AM, sohini dhar <[hidden email]> wrote:
>
> hiii,
> I want to know if i am making a normal distribution with the code
> Normal a=RandomHelper.createNormal(8, 2);
> how can i take a sample out of it....
>
> any help will be great.
>
> Regards,
> Sohini
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot_______________________________________________
> Repast-interest mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/repast-interest




------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest
Reply | Threaded
Open this post in threaded view
|

Re: help for normal distribution

Ozik, Jonathan
In reply to this post by sohini dhar-2
The best resource for you to look into would be the Colt Project website, from where the random distributions are taken: https://dst.lbl.gov/ACSSoftware/colt/

On Jun 17, 2017, at 5:45 AM, sohini dhar <[hidden email]> wrote:

hi,
Thank u so much for the help. My job is done.
I wanted to ask something else. If I have two distributions can I concatenate them and select a number from the resulting distribution.

Sohini.

On Thu, Jun 15, 2017 at 8:48 PM, Ozik, Jonathan <[hidden email]> wrote:
Sohini,

According to the Colt library API:
https://dst.lbl.gov/ACSSoftware/colt/api/cern/jet/random/Normal.html

nextDouble() should do the trick.

Jonathan

> On Jun 15, 2017, at 5:20 AM, sohini dhar <[hidden email]> wrote:
>
> hiii,
> I want to know if i am making a normal distribution with the code
> Normal a=RandomHelper.createNormal(8, 2);
> how can i take a sample out of it....
>
> any help will be great.
>
> Regards,
> Sohini
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot_______________________________________________
> Repast-interest mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/repast-interest


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest
Reply | Threaded
Open this post in threaded view
|

Re: help for normal distribution

Ozik, Jonathan
In reply to this post by sohini dhar-2
If you're interested in plotting statistical distributions I'd recommend the R statistical language (https://www.r-project.org). Repast isn't really geared towards doing that.

On Jun 17, 2017, at 6:38 AM, sohini dhar <[hidden email]> wrote:

also i want to know how can i plot a normal distribution in repast

On Sat, Jun 17, 2017 at 4:15 PM, sohini dhar <[hidden email]> wrote:
hi,
Thank u so much for the help. My job is done.
I wanted to ask something else. If I have two distributions can I concatenate them and select a number from the resulting distribution.

Sohini.

On Thu, Jun 15, 2017 at 8:48 PM, Ozik, Jonathan <[hidden email]> wrote:
Sohini,

According to the Colt library API:
https://dst.lbl.gov/ACSSoftware/colt/api/cern/jet/random/Normal.html

nextDouble() should do the trick.

Jonathan

> On Jun 15, 2017, at 5:20 AM, sohini dhar <[hidden email]> wrote:
>
> hiii,
> I want to know if i am making a normal distribution with the code
> Normal a=RandomHelper.createNormal(8, 2);
> how can i take a sample out of it....
>
> any help will be great.
>
> Regards,
> Sohini
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot_______________________________________________
> Repast-interest mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/repast-interest



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest
Reply | Threaded
Open this post in threaded view
|

Re: help for normal distribution

sohini dhar-2
ok..
actually i am trying to plot the power consumption of household appliances ,example a house contains 8 tube lights, their consumption depends on a normal distribution.
I am taking a distribution,and taking out a sample from it. and if the sample probability is greater than a particular threshold value,the appliance turns on.and then it turns off after the a particular duration which is again taken from a distribution.

Also i wish to plot the power consumption pattern for each 8 tube lights.

this is the code i have written

@ScheduledMethod(start=1,interval=1)
public double[] getdistribution()
{
double[] d=new double[24];
for(int i=1;i<=no_tubelights;i++)
{
Normal on_time = RandomHelper.createNormal(8, 2);
double a=RandomHelper.nextDouble();
Normal duration = RandomHelper.createNormal(3,1);
double b=RandomHelper.nextDouble();
double[] c=new double[8];
int[] state = new int[24];
for(int j=1;j<=state.length;j++)
{
 
if(a>threshold)
{
 
state[j]=1;
d[j] = pcon_tubelights;
c[i]=RandomHelper.nextDoubleFromTo(a, b);
}
else
{
state[j]=0;
d[j]=0;
}
}
ISchedule schedule = RunEnvironment.getInstance().getCurrentSchedule();
    double now = schedule.getTickCount();
    if(c[i]==now)
    {
    RunEnvironment.getInstance().endAt(now);
    }
 
}
return d;
}

On Sun, Jun 18, 2017 at 12:56 AM, Ozik, Jonathan <[hidden email]> wrote:
If you're interested in plotting statistical distributions I'd recommend the R statistical language (https://www.r-project.org). Repast isn't really geared towards doing that.

On Jun 17, 2017, at 6:38 AM, sohini dhar <[hidden email]> wrote:

also i want to know how can i plot a normal distribution in repast

On Sat, Jun 17, 2017 at 4:15 PM, sohini dhar <[hidden email]> wrote:
hi,
Thank u so much for the help. My job is done.
I wanted to ask something else. If I have two distributions can I concatenate them and select a number from the resulting distribution.

Sohini.

On Thu, Jun 15, 2017 at 8:48 PM, Ozik, Jonathan <[hidden email]> wrote:
Sohini,

According to the Colt library API:
https://dst.lbl.gov/ACSSoftware/colt/api/cern/jet/random/Normal.html

nextDouble() should do the trick.

Jonathan

> On Jun 15, 2017, at 5:20 AM, sohini dhar <[hidden email]> wrote:
>
> hiii,
> I want to know if i am making a normal distribution with the code
> Normal a=RandomHelper.createNormal(8, 2);
> how can i take a sample out of it....
>
> any help will be great.
>
> Regards,
> Sohini
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot_______________________________________________
> Repast-interest mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/repast-interest



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest
Reply | Threaded
Open this post in threaded view
|

Re: help for normal distribution

Ozik, Jonathan
Sohini,

One way to do this would be to make each of the tube lights an agent and add them to the main context (see https://repast.github.io/docs/RepastJavaGettingStarted.pdf for details on that if needed) and then collect their data for charting with Repast Simphony's built-in Data Collection capabilities, described here: https://repast.github.io/docs/DataCollection.pdf

Jonathan

On Jun 20, 2017, at 5:34 AM, sohini dhar <[hidden email]> wrote:

ok..
actually i am trying to plot the power consumption of household appliances ,example a house contains 8 tube lights, their consumption depends on a normal distribution.
I am taking a distribution,and taking out a sample from it. and if the sample probability is greater than a particular threshold value,the appliance turns on.and then it turns off after the a particular duration which is again taken from a distribution.

Also i wish to plot the power consumption pattern for each 8 tube lights.

this is the code i have written

@ScheduledMethod(start=1,interval=1)
public double[] getdistribution()
{
double[] d=new double[24];
for(int i=1;i<=no_tubelights;i++)
{
Normal on_time = RandomHelper.createNormal(8, 2);
double a=RandomHelper.nextDouble();
Normal duration = RandomHelper.createNormal(3,1);
double b=RandomHelper.nextDouble();
double[] c=new double[8];
int[] state = new int[24];
for(int j=1;j<=state.length;j++)
{
 
if(a>threshold)
{
 
state[j]=1;
d[j] = pcon_tubelights;
c[i]=RandomHelper.nextDoubleFromTo(a, b);
}
else
{
state[j]=0;
d[j]=0;
}
}
ISchedule schedule = RunEnvironment.getInstance().getCurrentSchedule();
    double now = schedule.getTickCount();
    if(c[i]==now)
    {
    RunEnvironment.getInstance().endAt(now);
    }
 
}
return d;
}

On Sun, Jun 18, 2017 at 12:56 AM, Ozik, Jonathan <[hidden email]> wrote:
If you're interested in plotting statistical distributions I'd recommend the R statistical language (https://www.r-project.org). Repast isn't really geared towards doing that.

On Jun 17, 2017, at 6:38 AM, sohini dhar <[hidden email]> wrote:

also i want to know how can i plot a normal distribution in repast

On Sat, Jun 17, 2017 at 4:15 PM, sohini dhar <[hidden email]> wrote:
hi,
Thank u so much for the help. My job is done.
I wanted to ask something else. If I have two distributions can I concatenate them and select a number from the resulting distribution.

Sohini.

On Thu, Jun 15, 2017 at 8:48 PM, Ozik, Jonathan <[hidden email]> wrote:
Sohini,

According to the Colt library API:
https://dst.lbl.gov/ACSSoftware/colt/api/cern/jet/random/Normal.html

nextDouble() should do the trick.

Jonathan

> On Jun 15, 2017, at 5:20 AM, sohini dhar <[hidden email]> wrote:
>
> hiii,
> I want to know if i am making a normal distribution with the code
> Normal a=RandomHelper.createNormal(8, 2);
> how can i take a sample out of it....
>
> any help will be great.
>
> Regards,
> Sohini
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot_______________________________________________
> Repast-interest mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/repast-interest



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest
Reply | Threaded
Open this post in threaded view
|

Re: help for normal distribution

sohini dhar-2
Great idea! 

On 21 Jun 2017 00:15, "Ozik, Jonathan" <[hidden email]> wrote:
Sohini,

One way to do this would be to make each of the tube lights an agent and add them to the main context (see https://repast.github.io/docs/RepastJavaGettingStarted.pdf for details on that if needed) and then collect their data for charting with Repast Simphony's built-in Data Collection capabilities, described here: https://repast.github.io/docs/DataCollection.pdf

Jonathan

On Jun 20, 2017, at 5:34 AM, sohini dhar <[hidden email]> wrote:

ok..
actually i am trying to plot the power consumption of household appliances ,example a house contains 8 tube lights, their consumption depends on a normal distribution.
I am taking a distribution,and taking out a sample from it. and if the sample probability is greater than a particular threshold value,the appliance turns on.and then it turns off after the a particular duration which is again taken from a distribution.

Also i wish to plot the power consumption pattern for each 8 tube lights.

this is the code i have written

@ScheduledMethod(start=1,interval=1)
public double[] getdistribution()
{
double[] d=new double[24];
for(int i=1;i<=no_tubelights;i++)
{
Normal on_time = RandomHelper.createNormal(8, 2);
double a=RandomHelper.nextDouble();
Normal duration = RandomHelper.createNormal(3,1);
double b=RandomHelper.nextDouble();
double[] c=new double[8];
int[] state = new int[24];
for(int j=1;j<=state.length;j++)
{
 
if(a>threshold)
{
 
state[j]=1;
d[j] = pcon_tubelights;
c[i]=RandomHelper.nextDoubleFromTo(a, b);
}
else
{
state[j]=0;
d[j]=0;
}
}
ISchedule schedule = RunEnvironment.getInstance().getCurrentSchedule();
    double now = schedule.getTickCount();
    if(c[i]==now)
    {
    RunEnvironment.getInstance().endAt(now);
    }
 
}
return d;
}

On Sun, Jun 18, 2017 at 12:56 AM, Ozik, Jonathan <[hidden email]> wrote:
If you're interested in plotting statistical distributions I'd recommend the R statistical language (https://www.r-project.org). Repast isn't really geared towards doing that.

On Jun 17, 2017, at 6:38 AM, sohini dhar <[hidden email]> wrote:

also i want to know how can i plot a normal distribution in repast

On Sat, Jun 17, 2017 at 4:15 PM, sohini dhar <[hidden email]> wrote:
hi,
Thank u so much for the help. My job is done.
I wanted to ask something else. If I have two distributions can I concatenate them and select a number from the resulting distribution.

Sohini.

On Thu, Jun 15, 2017 at 8:48 PM, Ozik, Jonathan <[hidden email]> wrote:
Sohini,

According to the Colt library API:
https://dst.lbl.gov/ACSSoftware/colt/api/cern/jet/random/Normal.html

nextDouble() should do the trick.

Jonathan

> On Jun 15, 2017, at 5:20 AM, sohini dhar <[hidden email]> wrote:
>
> hiii,
> I want to know if i am making a normal distribution with the code
> Normal a=RandomHelper.createNormal(8, 2);
> how can i take a sample out of it....
>
> any help will be great.
>
> Regards,
> Sohini
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot_______________________________________________
> Repast-interest mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/repast-interest



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest