Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8268481
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T05:54:15+00:00 2026-06-08T05:54:15+00:00

My problem is that I have a set of data which I want to

  • 0

My problem is that I have a set of data which I want to fit a distribution to, and then once I have found the distribution, run monte carlo simulation on it to propagate the found distribution.

My first bit of code is:

require(fitdistrplus)
example1<-c(29,23,29,25,26,29,29,27,25,25,25,26,28,25,29,28,28,26,28,25,29,26,30) 
f1<-fitdist(example1,rgamma,method="mle")

If I then use the command

print(f1)

it tells me that the shape is 204.00
and the rate is 7.568 for the gamma distribution

(please note the numbers I am fitting the distribution to are arbitrary at the moment, I would normally have hundreds of observations to fit the distribution to).

Where I now need help is when I use the code from package mc2d to propagate this distribution as follows:

require(mc2d)
ndunc(1000)
fitted<-mcstoc(rgamma, type="U", shape=204.00, rate=7.569)

Currently I am having to manually type in the shape and rate into this above function from the previous “print” of the “fitdist” command.

My question is, is there a way to get the mcstoc command to automatically pick up the shape and rate from the fitdist command so that I do not have to interrupt the code to do so manually? Or if it is not possible with the fitdistrplus package and mc2d package, then is there another package out there which might do this for me?

Many thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T05:54:16+00:00Added an answer on June 8, 2026 at 5:54 am
    f1$estimate[1]
    #   shape 
    #204.0008 
    
    f1$estimate[2]
    #    rate 
    #7.567762
    
    fitted<-mcstoc(rgamma, type="U", shape=f1$estimate[1], rate=f1$estimate[2])
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Problem: I have a value that is set in $record, for instance 1.69. Then
I have a problem while dealing with a data set which the value range
I have an odd problem with Django. I have a set of objects that
I have a problem removing breakpoints that are set when I attach to a
I have a problem with a javascript set of functions that I made. This
I have some problem with MySQL Workbench in that I sometimes can't set foreign
I have this problem decomposing a relation schema into a set of schemas that
Possible Duplicate: SmartGWT Dialog title not set correctly I have a problem, is that
I have an app which is displaying a data set which allows me to
I have a series of spectral data which I want to plot in a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.